Runs a battery of standard robustness and assumption tests for regression discontinuity designs: density continuity (McCrary/rddensity), covariate balance at the cutoff, bandwidth sensitivity, placebo cutoffs, and polynomial order sensitivity.

rd_assumption_tests(
  data,
  outcome,
  running_var,
  cutoff = 0,
  covariates = NULL,
  bw_seq = c(0.5, 0.75, 1, 1.25, 1.5),
  placebo_cutoffs = NULL,
  poly_orders = 1:4,
  kernel = "triangular",
  verbose = TRUE
)

Arguments

data

A data frame.

outcome

Character. Outcome variable name.

running_var

Character. Running (forcing) variable name.

cutoff

Numeric. RD cutoff. Default 0.

covariates

Character vector or NULL. Covariates to test for balance at the cutoff.

bw_seq

Numeric vector. Bandwidth multipliers to test in sensitivity analysis. Default c(0.5, 0.75, 1, 1.25, 1.5).

placebo_cutoffs

Numeric vector or NULL. Placebo cutoff values (should be far from cutoff). If NULL, auto-selected.

poly_orders

Integer vector. Polynomial orders to test. Default 1:4.

kernel

Character. RD kernel. Default "triangular".

verbose

Logical. Whether to print test results. Default TRUE.

Value

A list with:

density_test

Output from rddensity::rddensity().

covariate_balance

Data frame of RD estimates on each covariate.

bandwidth_sensitivity

Data frame of estimates at different bandwidths.

placebo_results

Data frame of placebo cutoff estimates.

poly_sensitivity

Data frame of estimates by polynomial order.

summary_report

Character. Text summary of all tests.

Examples

if (FALSE) { # \dontrun{
library(rdrobust)
data(rdrobust_RDsenate)
result <- rd_assumption_tests(
  data        = rdrobust_RDsenate,
  outcome     = "vote",
  running_var = "margin"
)
cat(result$summary_report)
} # }