Skip to contents

Donut-hole RDD

Usage

morie_rdd_donut(
  data,
  outcome,
  running,
  cutoff = 0,
  donut = 0,
  bandwidth = NULL,
  p = 1,
  kernel = "triangular",
  alpha = 0.05
)

Arguments

data

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

outcome

Character; column name of the response variable in data.

running

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

cutoff

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

donut

Numeric; symmetric window around the cutoff to drop in a donut-RDD robustness check (default 0).

bandwidth

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

p

Integer; local-polynomial order (default 1 for local- linear). 2 picks up quadratic curvature for bias correction.

kernel

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

alpha

Significance level (default 0.05).

Value

A named list with elements estimate, std_error, t_stat, p_value, ci_lower, ci_upper, n_obs, method, details.

Examples

set.seed(1)
x <- runif(800, -1, 1)
y <- 0.3 * x + 1.0 * (x >= 0) + rnorm(800, sd = 0.3)
d <- data.frame(x, y)
res <- morie_rdd_donut(d, "y", "x", donut = 0.05)
res$estimate
#> [1] 0.7945626