Create a regression discontinuity design
Builds a design with sample from population of size
N. The average treatment effect local to the cutpoint is equal to
tau. It allows for specification of the order of the polynomial regression (
poly_reg_order), cutoff value on the running variable (
cutoff), and size of bandwidth around the cutoff (
bandwidth). By providing a vector of numbers to
treatment_coefs, users can also specify polynomial regression coefficients that generate the expected control and treatment potential outcomes given the running variable.
regression_discontinuity_designer(N = 1000, tau = 0.15, outcome_sd = 0.1, cutoff = 0.5, bandwidth = 0.5, control_coefs = c(0.5, 0.5), treatment_coefs = c(-5, 1), poly_reg_order = 4, args_to_fix = NULL)
An integer. Size of population to sample from.
A number. Difference in potential outcomes functions at the threshold.
A positive number. The standard deviation of the outcome.
A number in (0,1). Threshold on running variable beyond which units are treated.
A number. The value of the bandwidth on both sides of the threshold from which to include units.
A vector of numbers. Coefficients for polynomial regression function that generates control potential outcomes. Order of polynomial is equal to length.
A vector of numbers. Coefficients for polynomial regression function that generates treatment potential outcomes. Order of polynomial is equal to length.
Integer greater than or equal to 1. Order of the polynomial regression used to estimate the jump at the cutoff.
A character vector. Names of arguments to be args_to_fix in design.
A regression discontinuity design.
See vignette online.
# Generate a regression discontinuity design using default arguments: regression_discontinuity_design <- regression_discontinuity_designer()