Reveal Observed Outcomes

reveal_outcomes(data = NULL, outcome_variable_names = Y,
  assignment_variable_names = Z, attrition_variable_names = NULL)

Arguments

data

A data.frame containing columns of potential outcomes and an assignment variable

outcome_variable_names

The outcome prefix(es) of the potential outcomes

assignment_variable_names

The bare (unquote) name(s) of the assignment variable

attrition_variable_names

The bare (unquote) name of the attrition variable

Details

Typically, a design includes a potential outcomes declaration and an assignment declaration. Reveal outcomes uses the random assignment to pluck out the correct potential outcomes. This is analogous to the "switching equation" (Gerber and Green 2012, Chapter 2).

Examples

my_population <- declare_population(N = 100, noise = rnorm(N)) my_potential_outcomes <- declare_potential_outcomes( Y_Z_0 = noise, Y_Z_1 = noise + rnorm(N, mean = 2, sd = 2)) my_assignment <- declare_assignment(m = 50) design <- declare_design(my_population, my_potential_outcomes, my_assignment, reveal_outcomes) design
#> #> Design Summary #> #> Step 1 (population): declare_population(N = 100, noise = rnorm(N)) ------------- #> #> N = 100 #> #> Added variable: ID #> N_missing N_unique class #> 0 100 character #> #> Added variable: noise #> min median mean max sd N_missing N_unique #> -2.23 -0.03 0 2.37 0.95 0 100 #> #> Step 2 (potential outcomes): declare_potential_outcomes(Y_Z_0 = noise, Y_Z_1 = noise + rnorm(N, mean = 2, sd = 2)) #> #> Added variable: Y_Z_0 #> min median mean max sd N_missing N_unique #> -2.23 -0.03 0 2.37 0.95 0 100 #> #> Added variable: Y_Z_1 #> min median mean max sd N_missing N_unique #> -3.93 2.08 2.13 8.09 2.47 0 100 #> #> Step 3 (assignment): declare_assignment(m = 50) -------------------------------- #> #> Added variable: Z #> 0 1 #> 50 50 #> 0.50 0.50 #> #> Added variable: Z_cond_prob #> 0.5 #> 100 #> 1.00 #> #> Step 4 (reveal outcomes): reveal_outcomes() ------------------------------------ #> #> Added variable: Y #> min median mean max sd N_missing N_unique #> -3.93 0.93 1.08 8.09 2.13 0 100 #>