View source: R/gen_blocked_data.R
generate_blocked_data_linear | R Documentation |
Function that, given a covariate vector X, returns a dataframe of potential outcomes and blocks.
Generate data, form_blocks_from_continuous, and randomize within block and generate observed potential outcomes
generate_blocked_data_linear(
X = c(0, 2, 3, 19, 20, 21, 24, 31, 32, 40, 41, 43, 45, 55, 60, 65),
a = 0,
b = 0,
ATE = 0.2,
d = 0
)
generate_blocked_data_obs_linear(
X = c(0, 2, 3, 19, 20, 21, 24, 31, 32, 40, 41, 43, 45, 55, 60, 65),
p = 0.5,
a = 0,
b = 0,
ATE = 0.2,
d = 0,
method = c("small", "pair", "big", "none")
)
X |
vector of indiviual level covariates |
a |
Intercept of Y0 |
b |
Main effect of X |
ATE |
Average Tx |
d |
Interaction effect term. |
p |
Proportion of units treated (as close as possible given block sizes) |
method |
How to block |
This uses the model: Y = a + bX + ATE Z + d X ATE + epsilon (It will standardize X for this model, and then standardize Y0, Y1 so sd(Y0) = 1.)
Dataframe with original potential outcomes and observed outcome based on random assigment.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.