Reveal Observed Outcomes

reveal_outcomes(data, outcome_variable_name = Y,
  assignment_variable_name = Z, attrition_variable_name = NULL)

Arguments

data

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

outcome_variable_name

The outcome prefix of the potential outcomes outcomes

assignment_variable_name

The bare (unquote) name of the assignment variable

attrition_variable_name

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): my_population --------------------------------------------- #> #> Added variable: ID #> N_missing N_unique #> 0 100 #> #> Added variable: noise #> min median mean max sd N_missing N_unique #> -2.57 0.05 0.11 2.87 1.02 0 100 #> #> Step 2 (potential outcomes): my_potential_outcomes ----------------------------- #> #> Added variable: Y_Z_0 #> min median mean max sd N_missing N_unique #> -2.57 0.05 0.11 2.87 1.02 0 100 #> #> Added variable: Y_Z_1 #> min median mean max sd N_missing N_unique #> -2.88 2.41 2.28 9.36 2.14 0 100 #> #> Step 3 (assignment): my_assignment --------------------------------------------- #> #> #> Random assignment procedure: Complete random assignment #> Number of units: 100 #> Number of treatment arms: 2 #> The possible treatment categories are 0 and 1. #> The probabilities of assignment are constant across units. #> #> Added variable: Z #> 0 1 #> Frequency 50 50 #> Proportion 0.50 0.50 #> #> Added variable: Z_cond_prob #> 0.5 #> Frequency 100 #> Proportion 1.00 #> #> Step 4 (reveal outcomes): reveal_outcomes -------------------------------------- #> #> Added variable: Y #> min median mean max sd N_missing N_unique #> -2.88 0.84 1.12 9.36 1.80 0 100 #>