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 The outcome prefix(es) of the potential outcomes The bare (unquote) name(s) of the assignment variable 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
#>
#>  N_missing N_unique     class
#>          0      100 character
#>
#>    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))
#>
#>    min median mean  max   sd N_missing N_unique
#>  -2.23  -0.03    0 2.37 0.95         0      100
#>
#>    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) --------------------------------
#>
#>     0    1
#>    50   50
#>  0.50 0.50
#>
#>