View source: R/gen_blocked_data.R
add_obs_data | R Documentation |
Given a passed potential outcomes schedule, randomize within block and generate observed potential outcomes and add them to the schedule.
add_obs_data(dat, p = 0.5, Y0 = "Y0", Y1 = "Y1", blockvar = "B")
dat |
Dataframe with a named Y0, Y1, and block column |
p |
Proportion of units treated. Can be vector and will treat that proportion in each block, rounded to nearest and with at least 1 treatment and control unit. |
Y0 |
name of Y0 column |
Y1 |
name of Y1 column |
blockvar |
name of blocking column. This column will be converted to a factor, if it is not already, and the order of p corresponds to the levels of this factor. |
augmented 'dat' with Z and Yobs columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.