Skip to contents

tau = alpha_plus - alpha_minus from kernel-weighted one-sided linear fits at the cutoff; IK plug-in bandwidth (Causrddh) and edge (triangular) kernel by default. HC0 sandwich per side, sides independent (rdrobust vce = "hc0" convention). Exact on side-linear data for any bandwidth.

Usage

Causrdd(x, y, cutoff = 0, h = NULL, kernel = "triangular")

Arguments

x

Running variable.

y

Outcome.

cutoff

Threshold c.

h

Bandwidth; IK plug-in when NULL.

kernel

"triangular" or "uniform".

Value

List with estimate, se, ci, intercept_left, intercept_right, slope_left, slope_right, h, kernel, n_left, n_right, n_used, method.

References

Imbens, G. and Kalyanaraman, K. (2009), NBER w14726, Sections 2-3; White (1980) HC0; Calonico, Cattaneo and Titiunik (2014), Econometrica 82(6), 2295-2326 (vce convention).

Examples

set.seed(1)
x <- runif(300, -1, 1)
y <- 1 + 2 * x + 0.5 * (x >= 0) + rnorm(300, 0, 0.3)
r <- Causrdd(x, y, cutoff = 0)
abs(r$estimate - 0.5) < 0.4
#> [1] TRUE