DesignLibrary (version 0.1.0)

block_cluster_two_arm_designer: Create a two-arm design with blocks and clusters

Description

Builds a two-arm design with blocks and clusters.

Usage

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)

Arguments

N_blocks

An integer. Number of blocks. Defaults to 1 for no blocks.

N_clusters_in_block

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.

N_i_in_cluster

An integer. Individuals per cluster. Defaults to 1 for no clusters.

sd_block

A nonnegative number. Standard deviation of block level shocks.

sd_cluster

A nonnegative number. Standard deviation of cluster level shock.

sd_i_0

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.

sd_i_1

A nonnegative number. Standard deviation of individual level shock in treatment. Defaults to sd_i_0.

rho

A number in [-1,1]. Correlation in individual shock between potential outcomes for treatment and control.

prob

A number in [0,1]. Treatment assignment probability.

control_mean

A number. Average outcome in control.

ate

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.

treatment_mean

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.

Value

A block cluster two-arm design.

Details

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.

Examples

Run this code
# 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