Skip to contents

CCT bias-corrected, robust-SE RDD inference

Usage

morie_rdd_bias_corrected(
  data,
  outcome,
  running,
  cutoff = 0,
  bandwidth = NULL,
  rho = NULL,
  p = 1,
  kernel = "triangular",
  alpha = 0.05,
  vce = "nn"
)

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).

bandwidth

Numeric; the local-polynomial bandwidth on each side of the cutoff. NULL invokes the MSE-optimal selector of rdrobust (morie_rd_mserd_bandwidth).

rho

Bandwidth ratio h/b for bias correction (Calonico, Cattaneo & Titiunik 2014). NULL (default): b is the MSE-optimal bias bandwidth when no bandwidth is given and b = h when one is, as rdrobust.

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).

vce

Residual variance: "nn" (nearest neighbour, the rdrobust default) or "hc" (plug-in residuals of the local fits).

Value

A numeric value.

Examples

set.seed(44)
x <- runif(1000, -1, 1)
y <- 0.5 + 0.8 * x - 0.4 * x^2 + 1.2 * (x >= 0) + rnorm(1000, 0, 0.4)
d <- data.frame(x, y)
bc <- morie_rdd_bias_corrected(d, "y", "x", bandwidth = 0.5, rho = 1)
bc$estimate
#> [1] 1.224297