Skip to contents

Routes to the native RDD toolbox: bias-corrected local linear estimation (morie_rdd_bias_corrected / morie_rdd_fuzzy), the Imbens-Kalyanaraman bandwidth (morie_rdd_bandwidth_ik), the McCrary manipulation test (morie_rdd_mccrary), and placebo cutoffs (morie_rdd_placebo_cutoff) – all in one call, so the diagnostics researchers routinely forget arrive with the estimate.

Usage

morie_rdd(
  data,
  outcome,
  running,
  cutoff = 0,
  treatment = NULL,
  bandwidth = NULL,
  placebo_cutoffs = NULL,
  alpha = 0.05
)

Arguments

data

Data frame.

outcome

Outcome column.

running

Running-variable column.

cutoff

Threshold. Default 0.

treatment

Optional treated-indicator column: when supplied, a fuzzy RDD (local Wald ratio) is estimated.

bandwidth

Optional bandwidth override (numeric).

placebo_cutoffs

Optional numeric vector of placebo cutoffs; defaults to the side medians.

alpha

CI tail. Default 0.05.

Value

Object of class "morie_rdd": estimate, std.error, conf.int, p.value, bandwidth, kind (sharp/fuzzy), manipulation (statistic + p), placebo (data.frame), n, call.

References

Imbens & Kalyanaraman (2012); Calonico, Cattaneo & Titiunik (2014); McCrary (2008).

Examples

set.seed(1)
x <- runif(500, -1, 1)
y <- 1 + 2 * (x >= 0) + x + rnorm(500, sd = 0.5)
morie_rdd(data.frame(y, x), "y", "x")
#> Regression discontinuity (sharp), bandwidth = 0.9543
#>   Estimate: 1.8551  (SE 0.1467)  95% CI [1.5676, 2.1426]  p = 1.19e-36
#>   Manipulation check (McCrary): stat = -1.06, p = 0.29