Regression kink design – slope discontinuity at the cutoff
Usage
morie_rdd_kink(
data,
outcome,
running,
cutoff = 0,
bandwidth = NULL,
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
Numeric; the local-polynomial bandwidth on each side of the cutoff.
NULLinvokes the data-driven CCT selector.- 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(45)
n <- 2000
x <- runif(n, -1, 1)
y <- 1 + 0.5 * x + 1.5 * pmax(x, 0) + rnorm(n, 0, 0.2)
df <- data.frame(x, y)
res <- morie_rdd_kink(df, "y", "x", bandwidth = 0.6)
res$estimate
#> [1] 2.100231
