Routes to make_design() with id "two_arm_flexible":
make_design("two_arm_flexible", N = N, assignment_prob = assignment_prob, ...).
Usage
two_arm_designer(
N = 100,
assignment_prob = 0.5,
control_mean = 0,
control_sd = 1,
ate = 1,
treatment_mean = NULL,
treatment_sd = NULL,
rho = 1,
args_to_fix = NULL
)Arguments
- N
Sample size.
- assignment_prob
Probability of assignment to treatment.
- control_mean
Average outcome in control.
- control_sd
Standard deviation in control.
- ate
Average treatment effect.
- treatment_mean
Average outcome in treatment. If supplied, overrides
ate(atebecomestreatment_mean - control_mean).- treatment_sd
Standard deviation in treatment. Defaults to
control_sd.- rho
Correlation between treatment and control potential outcomes.
- args_to_fix
Ignored. Present for compatibility with DesignLibrary 0.1.
Details
Builds a design with one treatment and one control arm. Treatment effects
can be specified by ate or by treatment_mean (which overrides ate).
Argument names match DesignLibrary 0.1's two_arm_designer.
Examples
make_design("two_arm_flexible", N = 40, ate = 0.2)
#> Research design with 6 steps
#>
#> Step 1 (parameters): declare_parameters(N = 100, assignment_prob = 0.5, control_mean = 0, control_sd = 1, ate = 1, treatment_sd = 1, rho = 1)
#> Step 2 (model): declare_model(N = N, u_0 = rnorm(N), u_1 = rnorm(n = N, mean = rho * u_0, sd = sqrt(pmax(0, 1 - rho^2))), potential_outcomes(Y ~ control_mean + (1 - Z) * (u_0 * control_sd) + Z * (u_1 * treatment_sd + ate)))
#> Step 3 (inquiry): declare_inquiry(ATE = mean(Y_Z_1 - Y_Z_0))
#> Step 4 (assignment): declare_assignment(Z = complete_ra(N, prob = assignment_prob))
#> Step 5 (measurement): declare_measurement(Y = reveal_outcomes(Y ~ Z))
#> Step 6 (estimator): declare_estimator(Y ~ Z, inquiry = "ATE")
#>
#> Parameters and objects the design refers to:
#> name value kind declared steps
#> assignment_prob 0.5 scalar TRUE 1, 4
#> ate 0.2 scalar TRUE 1, 2
#> control_mean 0 scalar TRUE 1, 2
#> control_sd 1 scalar TRUE 1, 2
#> N 40 scalar TRUE 1, 2
#> rho 1 scalar TRUE 1, 2
#> treatment_sd 1 scalar TRUE 1, 2
two_arm_designer(N = 40, ate = 0.2)
#> Research design with 6 steps
#>
#> Step 1 (parameters): declare_parameters(N = 100, assignment_prob = 0.5, control_mean = 0, control_sd = 1, ate = 1, treatment_sd = 1, rho = 1)
#> Step 2 (model): declare_model(N = N, u_0 = rnorm(N), u_1 = rnorm(n = N, mean = rho * u_0, sd = sqrt(pmax(0, 1 - rho^2))), potential_outcomes(Y ~ control_mean + (1 - Z) * (u_0 * control_sd) + Z * (u_1 * treatment_sd + ate)))
#> Step 3 (inquiry): declare_inquiry(ATE = mean(Y_Z_1 - Y_Z_0))
#> Step 4 (assignment): declare_assignment(Z = complete_ra(N, prob = assignment_prob))
#> Step 5 (measurement): declare_measurement(Y = reveal_outcomes(Y ~ Z))
#> Step 6 (estimator): declare_estimator(Y ~ Z, inquiry = "ATE")
#>
#> Parameters and objects the design refers to:
#> name value kind declared steps
#> assignment_prob 0.5 scalar TRUE 1, 4
#> ate 0.2 scalar TRUE 1, 2
#> control_mean 0 scalar TRUE 1, 2
#> control_sd 1 scalar TRUE 1, 2
#> N 40 scalar TRUE 1, 2
#> rho 1 scalar TRUE 1, 2
#> treatment_sd 1 scalar TRUE 1, 2