Learn R Programming

DesignLibrary (version 2.0.0)

two_arm_covariate_designer: Create a two-arm design with a possibly prognostic covariate

Description

Routes to make_design() with id "two_arm_covariate": make_design("two_arm_covariate", N = N, rho_WY = rho_WY, ...).

Usage

two_arm_covariate_designer(
  N = 100,
  prob = 0.5,
  control_mean = 0,
  sd = 1,
  ate = 1,
  h = 0,
  treatment_mean = NULL,
  rho_WY = 0,
  rho_WZ = 0,
  args_to_fix = NULL
)

Value

A design object.

Arguments

N

Sample size.

prob

Probability of assignment to treatment.

control_mean

Average outcome in control.

sd

Standard deviation of the outcome shock.

ate

Average treatment effect.

h

Heterogeneity of the treatment effect by W.

treatment_mean

Average outcome in treatment. If supplied, overrides ate (ate becomes treatment_mean - control_mean).

rho_WY

Correlation between W and the outcome shock (-1 to 1).

rho_WZ

Correlation between W and the latent assignment variable (-1 to 1).

args_to_fix

Ignored. Present for compatibility with DesignLibrary 0.1.

Details

The covariate W can predict the outcome (rho_WY), moderate the effect (h), and predict assignment (rho_WZ). With rho_WZ = 0 assignment is random and adjustment buys precision; otherwise W confounds. Argument names match DesignLibrary 0.1's two_arm_covariate_designer.

See Also

make_design()

Examples

Run this code
prognostic <- two_arm_covariate_designer(N = 40, ate = 0.2, rho_WY = 0.9, h = 0.5)
confounded <- two_arm_covariate_designer(N = 40, ate = 0, rho_WZ = 0.9, rho_WY = 0.9)

Run the code above in your browser using DataLab