Your data
Paste data or load the example.
Result
RD plot
binned means (20 bins a side) local fit within h cutoff
Does the answer depend on the bandwidth?
estimate and robust 95% interval, the chosen h filled
Take-up (first stage)
Estimates
| Estimate | Value | SE | 95% CI |
|---|
Placebo cutoffs and covariates
| Check | Jump | p |
|---|
Bunching at the cutoff
| Test | Below | Above | p |
|---|
The window counts follow the binomial test of Cattaneo, Titiunik & Vazquez-Bare; where the density slopes, wide windows tilt even without sorting, so the McCrary row is the one the summary uses.
Method and citation
On each side of the cutoff c, the tool fits a polynomial of order p in x − c by weighted least squares, with kernel weights that fall to zero at distance h. The conventional estimate is the difference between the two fitted values at c. Its leading bias is proportional to the (p+1)-th derivative of the outcome curve on each side; the tool estimates those from fits of order q = p+1 with a pilot bandwidth b and subtracts the bias. The robust standard error treats the bias-corrected estimate as one linear combination of the outcomes, so it includes the variance the bias estimate adds (Calonico, Cattaneo & Titiunik 2014). Residual variances come from the three nearest neighbours on the same side by default, or from the fitted residuals (HC0 to HC3).
The default bandwidth minimises the estimated mean squared error of the jump with one h for both sides (Calonico, Cattaneo & Farrell 2020), after pilot steps: a rule-of-thumb pilot for the variance, a global polynomial for the highest derivative, then local fits for each lower derivative, each step with a regularisation term for the noise in its bias estimate. In a fuzzy design the estimate is the outcome jump divided by the take-up jump, with a delta-method variance from the joint residuals; the bandwidth is chosen for the outcome jump.
Checks: the bandwidth sweep reruns the estimate at 0.5 to 2 times h with the same ratio b/h. Placebo cutoffs sit at the median of each side and use only that side's data, where no jump should exist. Covariates are run as outcomes with their own bandwidths. The density test is McCrary's (2008): a fine histogram, a local linear fit of its heights on each side at twice h, and the log difference at the cutoff with his standard error.
Verified by tests in the source against rdrobust 2.1.1 (the reference implementation by the method's authors, used only as an external program; none of its code is here): on 14 fixed-bandwidth cases (sharp and fuzzy, p from 0 to 3, all three kernels, nearest-neighbour and HC0-HC3 variances, a running variable with ties), the conventional, bias-corrected and robust estimates and standard errors agree within 1e-8, as do the counts inside h. The automatic bandwidth is this tool's own plug-in and lands at 0.75 to 1.06 times rdrobust's mserd on six test designs. On 1,000 simulated samples of 1,000 from the Lee calibration (true jump 0.04), the robust 95% interval at the automatic bandwidth covered the truth 93.7% of the time and the conventional one 91.7%.
Limits
- Local, not general. The estimate is the effect for units at the cutoff. It says nothing directly about units far from it.
- No sorting. If units can choose their side (retaking a test, editing an application), the comparison breaks; the density test catches heavy bunching, not subtle sorting.
- Mass points. With a discrete running variable (ages in years, whole test scores) there are few distinct values near the cutoff; the tool counts ties as neighbours but does not apply rdrobust's mass-point adjustment, and a local randomisation analysis may suit better.
- No covariate adjustment or clustering yet; covariates are tested for balance only.
- One cutoff. Multi-cutoff and geographic designs are not handled.
BibTeX
@article{calonico2014robust,
author = {Calonico, Sebastian and Cattaneo, Matias D. and Titiunik, Rocio},
title = {Robust Nonparametric Confidence Intervals for Regression-Discontinuity Designs},
journal = {Econometrica},
volume = {82}, number = {6}, pages = {2295--2326}, year = {2014},
doi = {10.3982/ECTA11757}
}
@article{calonico2020optimal,
author = {Calonico, Sebastian and Cattaneo, Matias D. and Farrell, Max H.},
title = {Optimal Bandwidth Choice for Robust Bias-Corrected Inference in Regression Discontinuity Designs},
journal = {The Econometrics Journal},
volume = {23}, number = {2}, pages = {192--210}, year = {2020},
doi = {10.1093/ectj/utz022}
}
@article{mccrary2008manipulation,
author = {McCrary, Justin},
title = {Manipulation of the Running Variable in the Regression Discontinuity Design: A Density Test},
journal = {Journal of Econometrics},
volume = {142}, number = {2}, pages = {698--714}, year = {2008},
doi = {10.1016/j.jeconom.2007.05.005}
}
@article{lee2008randomized,
author = {Lee, David S.},
title = {Randomized Experiments from Non-random Selection in {U.S.} House Elections},
journal = {Journal of Econometrics},
volume = {142}, number = {2}, pages = {675--697}, year = {2008},
doi = {10.1016/j.jeconom.2007.05.004}
}
Example data: 1,000 close elections simulated from the fifth-order polynomial calibration of Lee's (2008) House data used in the simulations of Calonico, Cattaneo & Titiunik (2014): vote margin as the running variable, next vote share as the outcome, and a prior vote share that does not jump. The true jump is 0.04. They are simulated, not Lee's data; eval/simulate.py regenerates them.
Questions
What does a regression discontinuity design answer?
Whether crossing a threshold changed an outcome: a scholarship for test scores above 80, a programme for incomes below a line, an election won by a margin above zero. Units just either side of the cutoff are alike in everything except which side they landed on, so the jump in the average outcome at the cutoff estimates the effect for units near it.
Why are there three estimates?
The conventional estimate fits a line on each side within the bandwidth. At the bandwidth that minimises mean squared error, its bias is not small next to its standard error, so its confidence interval covers the truth less often than it claims. The bias-corrected estimate subtracts an estimate of that bias, and the robust standard error also counts the noise in the bias estimate. Report the conventional point estimate with the robust interval, as Calonico, Cattaneo and Titiunik recommend.
How is the bandwidth chosen?
By default it is the bandwidth that minimises the estimated mean squared error of the jump, the same on both sides, from pilot fits of the curvature and the noise near the cutoff. You can set it yourself. The sweep shows the estimate from half to twice the chosen bandwidth, so you can see whether the answer depends on it.
What is a fuzzy regression discontinuity?
When crossing the cutoff raises the chance of treatment without making it certain, for example when not everyone eligible takes up a programme. Give the tool the 0/1 take-up column: it divides the jump in the outcome by the jump in take-up, which estimates the effect for units whose take-up is switched by the cutoff.
How do I know the design is valid?
No test proves it, but three checks catch common failures. Units should not bunch on one side of the cutoff (the McCrary density test), characteristics fixed before treatment should not jump (covariate balance), and the outcome should not jump at made-up cutoffs away from the real one (placebo cutoffs). The page runs all three.
Does it match rdrobust?
At a given bandwidth, yes: on 14 test cases covering sharp and fuzzy designs, polynomial orders 0 to 3, the three kernels and the five variance estimators, every estimate and standard error agrees with rdrobust 2.1.1 within 1e-8. The automatic bandwidth is this tool's own plug-in and lands at 0.75 to 1.06 times rdrobust's on the six test designs, so with the default bandwidth the numbers differ somewhat. Type rdrobust's bandwidth into the h and b boxes to reproduce it exactly.
Is my data uploaded anywhere?
No. The file is read and analysed by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.