View source: R/gen_blocked_data.R
generate_blocked_data | R Documentation |
This method is the one that generates the simulation data used in Pashley & Miratrix.
Generate data, form_blocks_from_continuous, and randomize within block and generate observed potential outcomes
generate_blocked_data(
n_k,
sigma_alpha = 1,
sigma_beta = 0,
beta = 5,
sigma_0 = 1,
sigma_1 = 1,
corr = 0.5,
exact = FALSE
)
generate_blocked_data_obs(n_k = c(2, 3, 4, 8), p = 0.5, ...)
n_k |
List of block sizes |
sigma_alpha |
Standard deviation of the block mean Y0s. |
sigma_beta |
Standard deviation of the block mean treatment effects (Y1-Y0)s. |
beta |
Block Average ATE. |
sigma_0 |
Standard deviation of residual Y0 added to block means (can be vector for individual variances per block). |
sigma_1 |
As 'sigma_0' but for Y1s. |
corr |
Correlation of Y0, Y1 within a block (can be vector of length K for different blocks). |
exact |
Passed to mvrnorm to control how block means are generated. |
p |
Proportion of units treated (as close as possible given block sizes). This can be a vector with a probability for each block. |
... |
Parameters to be passed to generate_blocked_data() |
The block means are sampled from a multivariate normal distribution. This can be controlled so the variances are exact using the 'exact' flag.
Dataframe with block indicators, Y0, and Y1.
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.