Skip to contents

Runs a sharp-RDD null test on each covariate.

Usage

morie_rdd_covariate_balance(
  data,
  running,
  covariates,
  cutoff = 0,
  bandwidth = NULL,
  kernel = "triangular",
  alpha = 0.05
)

Arguments

data

A data.frame holding the outcome, running variable, treatment, and any covariates referenced by name.

running

Character; column name of the running (forcing) variable in data.

covariates

Character vector of column names whose balance at the cutoff is checked.

cutoff

Numeric scalar; the threshold on running. Default 0 (the canonical normalisation).

bandwidth

Numeric; the local-polynomial bandwidth on each side of the cutoff. NULL invokes the data-driven CCT selector.

kernel

One of "triangular" (default), "epanechnikov", "uniform", or "gaussian".

alpha

Significance level (default 0.05).

Value

A data.frame of covariate-balance statistics, one row per covariate.

Examples

set.seed(1)
x <- runif(400, -1, 1)
y <- 0.3 * x + 1.0 * (x >= 0) + rnorm(400, sd = 0.3)
d <- data.frame(x, y, c1 = rnorm(400), c2 = rnorm(400))
out <- morie_rdd_covariate_balance(d, "x", c("c1", "c2"))
out
#>   covariate  estimate std_error   t_stat   p_value balanced
#> 1        c1 0.4085280 0.2417812 1.689660 0.0910930     TRUE
#> 2        c2 0.2898754 0.2639450 1.098242 0.2720989     TRUE