Skip to contents

Sharp RDD treatment effect at the cutoff

Usage

morie_rdd_sharp(
  data,
  outcome,
  running,
  cutoff = 0,
  bandwidth = NULL,
  p = 1,
  kernel = "triangular",
  cluster = NULL,
  covariates = NULL,
  alpha = 0.05
)

Arguments

data

Data frame.

outcome

Outcome column.

running

Running variable column.

cutoff

Threshold (default 0).

bandwidth

Optional bandwidth; if NULL, CCT MSE-optimal.

p

Local-polynomial order.

kernel

Kernel name.

cluster

Optional cluster column.

covariates

Optional character vector of covariate names.

alpha

Significance level.

Value

A named list with elements estimate, std_error, t_stat, p_value, ci_lower, ci_upper, n_obs, method, details.

Examples

set.seed(33)
n <- 1500
x <- runif(n, -1, 1)
y <- 0.5 * x + 0.3 * x^2 + 1.5 * (x >= 0) + rnorm(n, sd = 0.5)
d <- data.frame(y, x)
res <- morie_rdd_sharp(d, outcome = "y", running = "x", cutoff = 0)
res$estimate
#> [1] 1.506227