Regression Discontinuity Design – Sharp
Exploits a sharp cutoff in treatment assignment to estimate causal effects near the threshold.
One-Line Implementation
rdrobust(y = df$Y, x = df$X, c = 0)rdrobust y x, c(0)rdrobust(Y, X, c=0)Download Full Analysis Code
Complete scripts with diagnostics, robustness checks, and result export.
Motivating Example: The Incumbency Advantage in Elections
Does winning an election make a politician more likely to win the next election? You might think so — incumbents have name recognition, fundraising advantages, and can deliver benefits to their districts. But testing the incumbency advantage is hard. Politicians who win elections are different from those who lose: they may be more charismatic, better funded, or from more favorable districts. Simply comparing incumbents to non-incumbents conflates the effect of incumbency with all these pre-existing differences.
David Lee found an elegant solution(Lee, 2008). In a two-candidate race, the candidate who gets 50.1% of the vote wins, while the candidate who gets 49.9% loses. But these candidates are nearly identical — they ran in similar districts, spent similar amounts, and had similar qualities. The 0.2 percentage point difference in vote share that separates them is as-good-as random noise.
Lee's insight: by comparing candidates who barely won to candidates who barely lost, you get something close to a randomized experiment — but created naturally by the sharp cutoff rule that determines who wins. This approach is a regression discontinuity design (RDD).
The finding: in US House elections, barely winning increases the probability of winning the next election by roughly 40 percentage points. The incumbency advantage is real and substantial.
AOverview
What RDD Does
A regression discontinuity design exploits a rule that assigns treatment based on whether a continuous variable (the ) falls above or below a known cutoff. Units just above and just below the cutoff are almost identical on average — the only systematic difference between them is whether they received treatment. By comparing outcomes on either side of the cutoff, you can estimate the causal effect of treatment.
Why It Works
The key intuition is that units very close to the cutoff are "as good as randomly assigned" to treatment. A student who scores 71 on an exam and receives a scholarship is not meaningfully different from a student who scores 69 and does not. Their tiny score difference is as-good-as noise — influenced by whether they slept well, guessed correctly on one question, or had a good day. By zooming in on this narrow window around the cutoff, you approximate the conditions of a randomized experiment.
Sharp vs. Fuzzy
In a sharp RDD, the treatment is a deterministic function of the running variable: everyone above the cutoff is treated, everyone below is not. There is no discretion, no exceptions, no partial compliance. Examples:
- Scholarship awarded if test score >= 80 (everyone above gets it, no one below does)
- Politician wins if vote share > 50%
- Firm is regulated if revenue exceeds a threshold
In a fuzzy RDD, crossing the cutoff changes the probability of treatment but does not determine it perfectly. See the Fuzzy RDD page for that case. The fuzzy design is closely related to instrumental variables, where the cutoff serves as the instrument for actual treatment.
When to Use RDD
- Treatment is assigned by a rule based on a continuous running variable and a known cutoff
- The running variable is observed and measured accurately
- There is no evidence that units manipulate the running variable to sort around the cutoff
- You have enough observations near the cutoff
When NOT to Use RDD
- The running variable is discrete with few values (e.g., age in whole years) — the "as good as random" argument is weaker
- There is strong evidence of manipulation (e.g., students who know the cutoff score target exactly that score)
- You want to estimate the effect for the entire population, not just for units near the cutoff
- The cutoff is not sharp (treatment leaks across the boundary) — consider fuzzy RDD instead
The Taxonomy Position
RDD is a method. Its credibility comes from the institutional rule that generates the cutoff, not from a model of how confounders relate to outcomes. Unlike OLS, which requires the researcher to correctly specify all confounders, RDD leverages a specific institutional feature that produces quasi-random variation. Thistlethwaite and Campbell (1960) introduced the idea in the context of merit-based scholarships. Lee and Lemieux (2010) describe RDD as among the most credible and transparent non-experimental strategies for estimating causal effects. This characterization reflects RDD's strong internal validity when a sharp cutoff rule exists and manipulation is absent; it does not imply RDD is universally preferred, since the design is only applicable in settings with an institutional threshold and the resulting estimates are local to the cutoff.
Common Confusions
BIdentification
Assumption 1: Continuity of Potential Outcomes at the Cutoff
Plain language: Everything about units — their potential outcomes, their background characteristics, their unobserved traits — changes smoothly as the running variable crosses the cutoff. The only thing that jumps at the cutoff is treatment status. If you could graph every characteristic against the running variable, you would see smooth curves everywhere except in the treatment indicator, which jumps from 0 to 1.
Formally: and are continuous in at the cutoff , where and are potential outcomes without and with treatment.
This continuity condition is the core identifying assumption. If it holds, any discontinuity in the outcome at the cutoff can be attributed to the treatment.
Assumption 2: No Manipulation (No Precise Sorting)
Plain language: Units cannot precisely control their running variable to sort around the cutoff. If students who would score 69 can strategically boost their score to 71 to get a scholarship, the students just above and below the cutoff are no longer comparable — the ones above are those who tried harder or had the resources to manipulate their score.
"No manipulation" does not mean units are unaware of the cutoff or do not try to cross it. It means they cannot precisely control the running variable. In elections, candidates try hard to win, but they cannot guarantee they will get exactly 50.1% of the vote. The residual uncertainty in the running variable is what creates the quasi-random assignment.
Assumption 3: Treatment Assignment is Sharp
Plain language: Treatment is a deterministic function of the running variable. Everyone above the cutoff is treated; no one below is treated. If there are exceptions — people above the cutoff who do not receive treatment, or people below who do — you have a fuzzy RDD, which requires different estimation methods (in effect, IV/2SLS at the cutoff).
What RDD Identifies
Under these assumptions, the RDD estimates the average treatment effect at the cutoff:
This quantity is the expected treatment effect for units whose running variable is exactly at the threshold.
CVisual Intuition
The Jump at the Cutoff
The running variable (e.g., vote share) varies continuously across units.
Explore how bandwidth choice affects the bias-variance tradeoff in RDD estimation:
DMathematical Derivation
Don't worry about the notation yet — here's what this means in words: The RDD treatment effect is the difference in the limits of the conditional expectation function from the right and left of the cutoff.
Setup. Let be the running variable with cutoff . Treatment is:
The observed outcome is:
Step 1: Define the estimand.
The causal effect at the cutoff is:
Under the continuity assumption, and are continuous at . This continuity means:
Why? Because just above the cutoff, everyone is treated, so for . Just below, no one is treated, so for .
Step 2: Local polynomial estimation.
To estimate the limits from each side, fit separate polynomials above and below the cutoff, using only observations within a bandwidth of :
For observations with , fit:
For observations with , fit:
The RDD estimate is — the difference in the intercepts at the cutoff.
Step 3: Bandwidth selection.
The bandwidth controls a bias-variance tradeoff:
- Smaller : Less bias (observations closer to the cutoff are more comparable) but more variance (fewer observations used)
- Larger : More observations but greater risk that the polynomial misapproximates the true regression function
Calonico et al. (2014) developed a data-driven bandwidth selector that minimizes the asymptotic mean squared error of the estimator. This selector is what rdrobust uses by default.
Step 4: Bias-corrected inference.
The standard local polynomial estimator has a bias of order (where is the polynomial order). Calonico et al. (2014) proposed a bias-corrected estimator with robust confidence intervals that account for this bias. This correction is the "robust" in rdrobust.
EImplementation
The rdrobust Ecosystem
The standard approach for RDD estimation is the rdrobust package, developed by Cattaneo et al. (2020). It is available in Stata, R, and Python.
# Requires: rdrobust, rddensity
library(rdrobust)
library(rddensity)
# --- Step 1: Sharp RDD Estimate ---
# rdrobust() fits local polynomial regressions on each side of the cutoff.
# Automatically selects the mean squared error (MSE)-optimal bandwidth (Calonico, Cattaneo, Titiunik 2014).
# c = 0 is the cutoff value of the running variable.
rd <- rdrobust(y = df$y, x = df$x, c = 0)
# Output: conventional, bias-corrected, and robust estimates with CIs.
# Use the "Robust" row for inference (bias-corrected with robust SEs).
summary(rd)
# --- Step 2: RDD Visualization ---
# rdplot() creates a binned scatter with polynomial fits on each side.
# p = 1 fits local linear polynomials. The visible jump at c = 0
# is the treatment effect. This plot is the centerpiece of any RDD paper.
rdplot(y = df$y, x = df$x, c = 0, p = 1,
x.label = "Running Variable",
y.label = "Outcome",
title = "Sharp RDD Plot")
# --- Step 3: McCrary Density Test ---
# Tests for manipulation of the running variable around the cutoff.
# A significant result (low p-value) suggests agents sort across the
# threshold, violating the local randomization assumption.
density_test <- rddensity(X = df$x, c = 0)
summary(density_test)
# Visual density plot: should show no discontinuity in the density at c = 0
rdplotdensity(density_test, df$x)
# --- Step 4: Add Covariates for Precision ---
# covs adds pre-determined covariates. These improve precision but
# should NOT change the point estimate if the RDD is valid.
# A large change in the estimate when adding covariates is a red flag.
rd_cov <- rdrobust(y = df$y, x = df$x, c = 0,
covs = cbind(df$age, df$female))
summary(rd_cov)
# --- Step 5: Bandwidth Sensitivity ---
# Re-estimate at multiple bandwidths to check robustness.
# Stable estimates across bandwidths strengthen the design's credibility.
# Large swings suggest the result is sensitive to the estimation window.
for (h in c(5, 10, 15, 20)) {
cat("\nBandwidth =", h, "\n")
print(summary(rdrobust(y = df$y, x = df$x, c = 0, h = h)))
}Understanding the rdrobust Output
The key numbers to report from rdrobust:
- Conventional estimate: The local polynomial point estimate with conventional standard error
- Bias-corrected estimate: The point estimate after bias correction
- Robust confidence interval: Uses the bias-corrected estimate with a standard error that accounts for the additional variability introduced by the bias correction (preferred for inference)
- Bandwidth: The data-driven optimal bandwidth used
- Effective number of observations: How many observations fall within the bandwidth on each side
FDiagnostics
F.1 McCrary Density Test (Manipulation Check)
A key diagnostic for any RDD. If units can precisely sort around the cutoff, you will see a discontinuity in the density of the running variable at the cutoff. The McCrary test (and its modern successor rddensity) formally tests for this sorting behavior.
- If the density is smooth through the cutoff: no evidence of manipulation (good)
- If there is a jump in density: possible manipulation (serious threat to identification)
Example: If students know the scholarship cutoff is 80, and you see an excess of students scoring exactly 80-82 with a deficit at 78-79, that bunching is evidence of manipulation.
F.2 Covariate Balance (Placebo Tests)
Run the RDD on each pre-determined covariate (age, gender, prior achievement, etc.) as the outcome. If the running variable is as-good-as-randomly assigned near the cutoff, there should be no jump in any pre-determined covariate. This test is the RDD analog of the "balance table" in a randomized experiment.
F.3 Bandwidth Sensitivity
Re-estimate the treatment effect using a range of bandwidths (e.g., 0.5x, 0.75x, 1x, 1.25x, 1.5x, 2x the optimal bandwidth). If the estimate is stable across bandwidths, that stability is reassuring. If it swings wildly, the result may be fragile. For a broader discussion of robustness testing across specifications, see sensitivity analysis.
F.4 Placebo Cutoffs
Estimate the treatment effect at fake cutoffs where no treatment actually occurs (e.g., at the median of the running variable, or at percentiles far from the real cutoff). You should find no significant effects at these placebo cutoffs. If you do, something besides the treatment is causing discontinuities.
F.5
Remove observations very close to the cutoff (e.g., within 1 unit) and re-estimate. If the result is driven entirely by the handful of observations right at the boundary, it may be fragile or reflect manipulation by units who scored exactly at the cutoff.
Interpreting Your Results
A well-reported RDD analysis includes the following elements.
What to Report
- The RDD plot with the fitted lines and data points
- The point estimate, robust confidence interval, and p-value from
rdrobust - The optimal bandwidth and the effective number of observations on each side
- The McCrary density test results
- Covariate balance tests at the cutoff
- Sensitivity of the estimate to bandwidth choice
How to Interpret the Estimate
Common Misstatements to Avoid
- Avoid claiming the effect applies to all units — it is local to the cutoff
- Avoid using global high-order polynomials and presenting the approach as best practice
- Include the McCrary test
- Remember that the effective sample size is the number within the bandwidth, not the total sample
GWhat Can Go Wrong
Manipulation of the Running Variable
Running variable is as-good-as-random near the cutoff (e.g., election vote share)
McCrary test p = 0.34, smooth density at cutoff. RDD estimate is valid.
Global High-Order Polynomial
Local linear regression within optimal bandwidth (rdrobust default)
Estimate = 5.0 (SE = 1.2). Stable, interpretable, low sensitivity to distant observations.
Discrete Running Variable
Running variable is continuous (e.g., vote share to many decimal places)
RDD estimate = 0.15 (SE = 0.04), p = 0.001. With 2,400 unique values of vote share within the optimal bandwidth, observations just above and below the cutoff are truly comparable. Placebo cutoff tests yield estimates of 0.01 and -0.02, confirming no spurious jumps.
HPractice
H.1 Concept Checks
A scholarship is awarded to all students who score 80 or above on a standardized test. A researcher estimates that the scholarship increases college enrollment by 15 percentage points using an RDD. This estimate tells you the effect for:
You are running an RDD and the McCrary density test has a p-value of 0.001. What does this suggest?
A researcher estimates an RDD using a 5th-order global polynomial and finds a large, significant treatment effect. When they switch to local linear regression with rdrobust, the effect shrinks and becomes insignificant. What is the likely explanation?
You run covariate balance tests at the cutoff and find that age, income, and gender show no discontinuity, but race shows a significant jump (p = 0.02). Should you be concerned?
In Lee's (2008) incumbency study, why is the vote share margin a good running variable for RDD?
H.2 Guided Exercise
You are analyzing a scholarship program that awards funding to students who score 80 or above on an exam. Fill in the blanks.
You have test scores for 2,000 students. Running rdrobust with the cutoff at 80, you obtain:
Conventional estimate: 12.5 (SE = 3.1) Bias-corrected (robust) estimate: 11.8 (robust SE = 3.6) Robust 95% CI: [4.7, 18.9] Optimal bandwidth: 7.2 points Effective N (left of cutoff): 312 Effective N (right of cutoff): 298 McCrary test p-value: 0.41
H.3 Error Detective
Read the analysis below carefully and identify the errors.
A researcher studies whether winning a close government contract affects firm innovation. The running variable is the firm's bid score relative to the winning threshold. They estimate:
reg patents treatment bid_score bid_score_sq bid_score_cu bid_score_4th bid_score_5th, vce(robust)
They find: coefficient on treatment = 3.8 patents (SE = 1.2, p = 0.002). They report: "Using a regression discontinuity design, we find that winning a government contract increases patenting by 3.8 patents per year."
Select all errors you can find:
Read the analysis below carefully and identify the errors.
A health policy researcher studies whether Medicare eligibility at age 65 affects health outcomes. They use age as the running variable with the cutoff at 65. The running variable is age measured in whole years. They find a large jump in hospitalization rates at 65 using rdrobust.
rdrobust hospitalizations age, c(65)
Estimate: 15.2 additional hospitalizations per 1000 (robust SE = 4.1, p < 0.001).
"The sharp increase in hospitalizations at age 65 shows that Medicare coverage significantly increases healthcare utilization."
Select all errors you can find:
H.4 You Are the Referee
Read the paper summary below and write a brief referee critique (2-3 sentences) of the identification strategy.
Paper Summary
The authors study whether winning a close mayoral election affects city-level economic growth. The running variable is the winner's vote margin. Using a sharp RDD with rdrobust, they compare cities where the eventual mayor won by less than 5 percentage points. They find that cities where a pro-business candidate barely won grew 1.3 percentage points faster over the next 4 years than cities where the opposing candidate barely won. The McCrary test shows no manipulation (p = 0.62). Covariate balance tests show no discontinuity in city size, income, or industry composition at the cutoff.
Key Table
| Variable | RDD Estimate | Robust SE | Robust 95% CI |
|---|---|---|---|
| GDP growth (4-year) | 1.30 | 0.52 | [0.28, 2.32] |
| Optimal bandwidth | 4.8 pp | ||
| Effective N (left) | 142 | ||
| Effective N (right) | 156 | ||
| McCrary p-value | 0.62 | ||
| Covariate balance tests | All p > 0.1 |
Authors' Identification Claim
In close elections, the winning margin is effectively random, making this design equivalent to a randomized experiment. The McCrary test and covariate balance support this claim.
ISwap-In: When to Use Something Else
- Fuzzy RDD: When the cutoff induces a jump in the probability of treatment but not a deterministic shift — fuzzy RDD uses the threshold as an instrument for treatment receipt.
- Difference-in-differences: When there is no sharp threshold but a policy change creates treated and untreated groups with temporal variation.
- IV / 2SLS: When the source of exogenous variation is not a threshold on a running variable but a discrete instrument (e.g., lottery, draft number).
- Matching: When there is no threshold but rich observational data allow for matching on pre-treatment covariates.
- RDD with covariates: When the bandwidth is narrow and precision is low, adding pre-determined covariates can improve efficiency without threatening identification.
JReviewer Checklist
Critical Reading Checklist
Paper Library
Foundational (8)
Calonico, S., Cattaneo, M. D., & Titiunik, R. (2014). Robust Nonparametric Confidence Intervals for Regression-Discontinuity Designs.
Calonico, Cattaneo, and Titiunik develop bias-corrected confidence intervals for RDD that address the problem of conventional confidence intervals being invalid when using optimal bandwidth selectors. Their rdrobust software package has become the standard tool for implementing RDD in practice.
Cattaneo, M. D., Titiunik, R., & Vazquez-Bare, G. (2019). Power Calculations for Regression-Discontinuity Designs.
Cattaneo, Titiunik, and Vazquez-Bare provide methods and software for power calculations in RDD, essential for study design and determining adequate sample sizes near the cutoff. The associated rdsampsi command enables researchers to plan appropriately powered RDD studies before data collection.
Dong, Y. (2015). Regression Discontinuity Applications with Rounding Errors in the Running Variable.
Dong examines regression discontinuity designs when the running variable is subject to rounding or heaping, a common practical concern. She shows that standard RD estimators can be biased in such settings and derives correction formulas for the resulting discretization bias, extending the applicability of RDD to settings with imperfect measurement of the running variable.
Gelman, A., & Imbens, G. W. (2019). Why High-Order Polynomials Should Not Be Used in Regression Discontinuity Designs.
Gelman and Imbens show that using high-order global polynomials in RDD leads to noisy estimates, sensitivity to the degree of polynomial, and poor coverage of confidence intervals. They recommend local linear or quadratic fits with appropriate bandwidth selection instead, fundamentally changing best practice for RDD estimation.
Imbens, G. W., & Lemieux, T. (2008). Regression Discontinuity Designs: A Guide to Practice.
Imbens and Lemieux provide a comprehensive practical guide to implementing RDD, covering bandwidth selection, functional form, and graphical analysis. Their treatment of fuzzy RDD as a local IV estimator clarifies the interpretation and implementation for applied researchers.
Lee, D. S. (2008). Randomized Experiments from Non-random Selection in U.S. House Elections.
Lee formalizes the conditions under which an RDD is 'as good as' a randomized experiment—namely, when agents cannot precisely manipulate the running variable around the cutoff. Applied to U.S. House elections, this paper establishes the modern theoretical foundation for sharp RDD.
McCrary, J. (2008). Manipulation of the Running Variable in the Regression Discontinuity Design: A Density Test.
McCrary develops the standard test for whether agents are manipulating the running variable to sort around the cutoff. If the density of the running variable shows a discontinuity at the cutoff, the RDD is compromised. This density test is now a routine validity check in all RDD papers.
Thistlethwaite, D. L., & Campbell, D. T. (1960). Regression-Discontinuity Analysis: An Alternative to the Ex Post Facto Experiment.
Thistlethwaite and Campbell introduce the regression discontinuity design, proposing to compare units just above and just below a cutoff score to estimate causal effects, reasoning that units near the cutoff are as-good-as randomly assigned. The idea lies dormant for decades before being rediscovered by economists.
Application (3)
Chava, S., & Roberts, M. R. (2008). How Does Financing Impact Investment? The Role of Debt Covenants.
Chava and Roberts use an RDD around debt covenant thresholds to study how covenant violations affect firm investment. This paper is an important early application of RDD in corporate finance, where accounting-based thresholds create natural discontinuities.
Dell, M. (2010). The Persistent Effects of Peru's Mining Mita.
Dell uses a geographic RDD exploiting the historical boundary of the mita forced labor system in Peru to estimate the persistent effect of colonial institutions on economic outcomes centuries later. The study demonstrates how RDD can exploit spatial discontinuities, not just score-based cutoffs.
Flammer, C. (2015). Does Corporate Social Responsibility Lead to Superior Financial Performance? A Regression Discontinuity Approach.
Flammer uses a regression discontinuity design around close-call shareholder votes on CSR proposals, comparing proposals that pass or fail by a small margin as a quasi-experiment. She finds that adopting CSR proposals leads to positive announcement returns and superior accounting performance, with effects operating through labor productivity and sales growth. Published in Management Science, it is a prominent example of RDD in top management journals.
Survey (6)
Angrist, J. D., & Pischke, J.-S. (2009). Mostly Harmless Econometrics: An Empiricist's Companion.
Angrist and Pischke write one of the most influential modern textbooks on applied econometrics, organizing the field around a design-based approach to causal inference. The book provides essential treatments of instrumental variables, difference-in-differences, and regression discontinuity, each grounded in the potential outcomes framework. It remains the standard reference for graduate students learning to evaluate and implement identification strategies.
Cattaneo, M. D., Idrobo, N., & Titiunik, R. (2020). A Practical Introduction to Regression Discontinuity Designs: Foundations.
Cattaneo, Idrobo, and Titiunik provide a practical and accessible guide to implementing regression discontinuity designs, covering both sharp and fuzzy cases with worked examples and code. Part of the Cambridge Elements series, it provides step-by-step guidance on bandwidth selection, estimation, and inference using the rdrobust toolkit.
Cattaneo, M. D., & Titiunik, R. (2022). Regression Discontinuity Designs.
Cattaneo and Titiunik survey the state of the art in RDD methodology, including extensions to fuzzy designs, geographic RDD, and multi-cutoff designs. They provide guidance on current recommended practices and an excellent entry point to the modern RDD literature.
Cattaneo, M. D., Idrobo, N., & Titiunik, R. (2024). A Practical Introduction to Regression Discontinuity Designs: Extensions.
Cattaneo, Idrobo, and Titiunik cover extensions of the regression discontinuity framework in this follow-up volume, including multi-score designs, geographic RDD, kink designs, and discrete running variables. They provide practical guidance and software implementations for these more advanced settings, making it an essential companion for applied researchers going beyond the standard sharp RDD.
Cunningham, S. (2021). Causal Inference: The Mixtape.
Cunningham provides an accessible textbook with an excellent DiD chapter that walks through the intuition, the math, and the code (in Stata and R). Freely available online at mixtape.scunning.com, it is a valuable companion for students who want worked examples alongside formal treatment.
Lee, D. S., & Lemieux, T. (2010). Regression Discontinuity Designs in Economics.
Lee and Lemieux write the standard survey of RDD methods in economics, covering both sharp and fuzzy designs, validity tests, and extensions. This paper is the standard reference for understanding the econometric theory and practical implementation of RDD.