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.frameholding 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. Default0(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).
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.07544647 1.338187 0.3264025 4.134958e-05 0.6984500 1.977924
#> 2 0.10059529 1.300020 0.2922243 8.638926e-06 0.7272708 1.872769
#> 3 0.12574412 1.232117 0.2550881 1.364220e-06 0.7321533 1.732080
#> 4 0.15089294 1.158346 0.2268739 3.295996e-07 0.7136818 1.603011
#> 5 0.17604177 1.113400 0.2098670 1.125087e-07 0.7020686 1.524732
#> 6 0.20119059 1.105325 0.1952651 1.508110e-08 0.7226126 1.488038
#> 7 0.22633941 1.118786 0.1812321 6.691344e-10 0.7635772 1.473994
#> 8 0.25148824 1.123174 0.1713955 5.635084e-11 0.7872448 1.459103
#> 9 0.27663706 1.114098 0.1625117 7.106695e-12 0.7955809 1.432615
#> 10 0.30178588 1.100946 0.1547179 1.112452e-12 0.7977042 1.404187
