Builds a two-arm design with blocks and clusters.
block_cluster_two_arm_designer(N_blocks = 1, N_clusters_in_block = 100,
N_i_in_cluster = 1, sd_block = 0.5, sd_cluster = 0.5,
sd_i_0 = sqrt(max(0, 1 - sd_block^2 - sd_cluster^2)),
sd_i_1 = sd_i_0, rho = 1, prob = 0.5, control_mean = 0,
ate = 0, treatment_mean = control_mean + ate)
An integer. Number of blocks. Defaults to 1 for no blocks.
An integer. Number of clusters in each block. This is the total N
when N_blocks
and N_i_in_cluster
are at default values.
An integer. Individuals per cluster. Defaults to 1 for no clusters.
A nonnegative number. Standard deviation of block level shocks.
A nonnegative number. Standard deviation of cluster level shock.
A nonnegative number. Standard deviation of individual level shock in control. For small sd_block
and sd_cluster
, sd_i_0
defaults to make total variance = 1.
A nonnegative number. Standard deviation of individual level shock in treatment. Defaults to sd_i_0
.
A number in [-1,1]. Correlation in individual shock between potential outcomes for treatment and control.
A number in [0,1]. Treatment assignment probability.
A number. Average outcome in control.
A number. Average treatment effect. Alternative to specifying treatment_mean
. Note that ate is an argument for the designer but it does not appear as an argument in design code (design code uses control_mean
and treatment_mean
only.) only.
A number. Average outcome in treatment. Note: if treatment_mean
is not provided then it is calculated from ate
. If both ate
and treatment_mean
are provided then only treatment_mean
is used.
A block cluster two-arm design.
Units are assigned to treatment using complete block cluster random assignment. Treatment effects can be specified either by providing control_mean
and treatment_mean
or by specifying an ate
. Estimation uses differences in means accounting for blocks and clusters.
Total N is given by N_blocks*N_clusters_in_block*N_i_in_cluster
Normal shocks can be specified at the individual, cluster, and block levels. If individual level shocks are not specified and cluster and block level variances sum to less than 1, then individual level shocks are set such that total variance in outcomes equals 1.
Key limitations: The designer assumes covariance between potential outcomes at individual level only.
# NOT RUN {
# Generate a design using default arguments:
block_cluster_two_arm_design <- block_cluster_two_arm_designer()
# }
Run the code above in your browser using DataCamp Workspace