Skip to contents

Bandwidth sensitivity sweep

Usage

morie_rdd_bandwidth_sensitivity(
  data,
  outcome,
  running,
  cutoff = 0,
  bandwidth_range = 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).

bandwidth_range

Numeric vector of candidate bandwidths used by the sensitivity analysis.

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 data.frame of RDD estimates across bandwidths, one row per bandwidth.

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)
out <- morie_rdd_bandwidth_sensitivity(d, "y", "x")
out
#>    bandwidth estimate  std_error      p_value  ci_lower ci_upper
#> 1  0.1544393 1.150223 0.22413529 2.869498e-07 0.7109255 1.589520
#> 2  0.2059191 1.106956 0.19218353 8.416866e-09 0.7302832 1.483629
#> 3  0.2573988 1.121474 0.16932984 3.519516e-11 0.7895932 1.453354
#> 4  0.3088786 1.096528 0.15232898 6.091519e-13 0.7979683 1.395087
#> 5  0.3603583 1.083657 0.13805264 4.173870e-15 0.8130790 1.354235
#> 6  0.4118381 1.084266 0.12808646 2.559181e-17 0.8332207 1.335310
#> 7  0.4633179 1.090357 0.11940797 6.764224e-20 0.8563222 1.324393
#> 8  0.5147976 1.100129 0.11185462 7.929481e-23 0.8808978 1.319360
#> 9  0.5662774 1.108043 0.10534696 7.134883e-26 0.9015663 1.314519
#> 10 0.6177572 1.111057 0.09943565 5.489115e-29 0.9161668 1.305947