Econometrics · Chapter 13
Regression Discontinuity
Score 49 on the exam and you get nothing. Score 50 and you get a free summer of tutoring. A student at 49 and a student at 50 are about as alike as two students can be, so if next year’s scores jump right at 50, the tutoring is the likely cause. Rules with cutoffs are everywhere: scholarships, class-size caps, loan approvals, elections won by one vote. Here you’ll measure a jump with lines you can stretch and shrink, find the bandwidth that balances bias against noise, catch students who game the cutoff, and handle the messy “fuzzy” case where not everyone follows the rule.
True curve
Plot
Polynomial order
Live numbers
Missions
What you’re seeing
The rule. Every student who scores 50 or more on this year’s exam gets free summer tutoring; nobody below 50 does. Each dot is one simulated student: this year’s score across, next year’s score up. The white circles are averages of students within two points of each other, which show the shape of the cloud.
The window and the lines. The shaded strip is the bandwidth: only students within that many points of 50 are used. Inside it, a line (or a curve, if you raise the order) is fitted separately on each side, giving more weight to students closer to 50 (the triangular kernel). Where the two fits meet the cutoff, the green bracket measures the jump. That jump is the estimate of what tutoring does. Drag the edges of the strip to change it.
The truth. The pink dashed curve is what the simulation knows and a researcher doesn’t: the average next-year score at each score, with the true jump built in. When your fitted lines miss the pink curve right at 50, the estimate is biased, and “bias from the curve” in the card says by how much.
The histogram. Below the scatter is the number of students at each score. Without any gaming, it should flow smoothly through 50. Turn on manipulation and some students just below 50 get pushed over (a regrade, a retake, a friendly teacher): a pile appears right above the cutoff, and the density test flags it.
A jump at the cutoff
A regression discontinuity design needs three things: a running variable x (here the exam score), a cutoff c (50), and a treatment that switches on at the cutoff. In a sharp design, the rule is followed exactly: D = 1 if x ≥ c and 0 otherwise. Students far from 50 are different in many ways, so comparing all tutored students with all others would mix tutoring with ability. But just around 50, the tutored and untutored are nearly the same people. The effect at the cutoff is the gap between the two sides of the curve:
The assumption that makes this the causal effect is continuity: without the treatment, the average outcome would flow smoothly through the cutoff. In potential-outcomes terms, E[y(0) | x] and E[y(1) | x] are continuous at c. Nothing else may change at 50. If the same cutoff also decided who gets a laptop, the jump would mix tutoring with laptops.
Local randomization
Why is continuity believable? David Lee (2008) gave the key argument: as long as people cannot precisely control their score, luck decides which side of 50 a student lands on. A student aiming for 50 might get 48 or 52 depending on a sleepy morning or a lucky guess. Near the cutoff, the treatment is then as good as randomly assigned, like a small randomized experiment hidden inside the rule. That also tells you what can break the design: anyone who can choose their side precisely (a teacher who regrades papers at 49, a firm that keeps its payroll at 49 workers to dodge a 50-worker rule).
Local linear regression
You can’t observe the limit, so you estimate it. The standard tool is local linear regression: on each side, fit a line to the students within h points of the cutoff, weighting each by a kernel K that falls as distance grows, and read off where the line hits c. Below the cutoff, choose a−, b− to minimize
do the same above, and estimate τ̂ = â+ − â−. With a uniform kernel this is the same as one OLS regression on the students in the window, y = α + τ·D + β(x − c) + γ·D·(x − c) + u, where the interaction lets the slopes differ on the two sides. Why a line and not just the average on each side? Because the outcome usually slopes upward through the cutoff. Averages over a window compare students at about 45 with students at about 55, and that gap counts the slope as if it were an effect. Choose “Kink” and order 0 in the simulation to see a big, confident, wrong answer.
Within 10 points of the cutoff, the two weighted fits are
- At x = 50 both slope terms are zero, so the fits reach 58.6 and 64.9.
- The jump: τ̂ = 64.9 − 58.6 = 6.3 points.
- The two sides use different students, so their errors are independent: with intercept standard errors of 1.2 and 1.3, SE(τ̂) = √(1.2² + 1.3²) = √3.13 ≈ 1.77, and the 95% interval is 6.3 ± 1.96 × 1.77 ≈ [2.8, 9.8].
The slopes differ (0.52 vs 0.31), and that is allowed: tutoring may help weaker students more. Only the gap at 50 is the estimate.
Choosing the bandwidth: bias against variance
The bandwidth is the main choice in any RD study, and it is a real trade-off. A narrow window uses only students very close to 50, so the line is a good local approximation (little bias), but there are few of them (lots of noise). A wide window has many students (little noise), but the true curve bends over a wide range, and a straight line through a bent curve misses at the cutoff (bias). The quantity that balances both is the mean squared error:
“Scan bandwidths” estimates both by brute force: for each of 14 bandwidths, it draws 150 fresh samples from the known truth and records how far the estimates land from it. Real researchers can’t do that, because they don’t know the truth, so they estimate the curvature from the data and use a formula for the MSE-optimal bandwidth (Imbens and Kalyanaraman, 2012). Sebastian Calonico, Matias Cattaneo and Rocío Titiunik (2014) then showed that the usual confidence interval is too narrow at that bandwidth, because the bias is not negligible there, and proposed “robust bias-corrected” intervals, now the default in their widely used rdrobust software.
An older habit was to fit a 3rd- or 4th-order polynomial to the whole range and read the jump at the cutoff. It looks flexible, but the fit at the edge of each side is pulled around by students far from the cutoff, and the estimate is noisy and sensitive to the order you pick. Andrew Gelman and Guido Imbens (2019) argued against it. Try order 4 with a bandwidth of 50: the curve bends near 50 and the standard error is about twice that of a straight line (2.07 vs 0.97 in our tests). Local linear (or local quadratic) fits within a bandwidth are the modern default.
Checking the design
The continuity assumption can’t be tested directly, but it has consequences you can check.
If people could push themselves over the cutoff, there would be too many just above it. Justin McCrary’s (2008) test estimates the density of the running variable on each side and tests whether it jumps: θ̂ = ln f̂+ − ln f̂−.
Anything fixed before the cutoff was applied (last year’s homework, age, family income) should not jump at the cutoff. Run the same RD on it as a placebo outcome.
Pretend the cutoff is at 40 or 60, where nothing happens. Estimated jumps there should be near zero.
Report estimates over a range of bandwidths and polynomial orders, and a “donut” version that drops the students right at the cutoff, where any gaming happens.
A histogram of 2-point bins shows 61 students at 46–47, 58 at 48–49, 97 at 50–51 and 63 at 52–53. If the density were smooth, the counts just below and just above 50 should be similar, around 60.
- The bin just above 50 has 97, about 37 more than its neighbors suggest.
- Under a smooth density, a bin count of about 60 has a standard deviation near √60 ≈ 7.7, so 97 is about 4.8 standard deviations high.
- The bin just below, 48–49, is a little low (58), as if students moved from below to above.
This is a strong sign of manipulation. The fix is not statistical: find out how scores near 50 were produced, and report results without the students closest to the cutoff.
Fuzzy RD: when the rule is only a nudge
Often the cutoff changes the chance of treatment instead of switching it fully on. Tutoring may be offered at 50, but some offered students skip it, and some below 50 find tutoring elsewhere. Then the jump in outcomes is smaller than the effect of tutoring, because only some students’ tutoring status changed at 50. Jinyong Hahn, Petra Todd and Wilbert van der Klaauw (2001) showed how to scale it back up: divide the jump in outcomes by the jump in the share treated.
This is exactly instrumental variables (Chapter 10), with “being above the cutoff” as the instrument for treatment, and in practice it is estimated by two-stage least squares on the students in the window, controlling for the score on each side. It estimates a local average treatment effect: the effect for compliers at the cutoff, the students who take tutoring if they score 50 but wouldn’t at 49.
In this simulation, more motivated students are more likely to sign up for tutoring at any score, and motivation also raises next year’s score. So comparing students who took tutoring with those who didn’t, even within the window, credits tutoring with the motivation: that comparison is several points too high. The fuzzy RD only uses the part of take-up that the cutoff caused, and lands near the truth.
Just below 50, 22% of students take tutoring; just above, 64%. Next year’s score jumps by 2.1 points at the cutoff (SE 0.9).
- First stage: 0.64 − 0.22 = 0.42. The cutoff moved 42% of students into tutoring.
- Reduced form: 2.1 points for everyone at the cutoff, tutored or not.
- Fuzzy RD: 2.1 ÷ 0.42 = 5.0 points for each student whose tutoring the cutoff changed. If the first stage is estimated precisely, the standard error is roughly 0.9 ÷ 0.42 ≈ 2.1.
With a first stage of 0.05 instead, the same 2.1-point jump would mean 42 points, and the standard error would be 18: a weak first stage turns small noise into huge swings.
Two famous designs
Israeli public schools cap classes at 40 students, a rule that Joshua Angrist and Victor Lavy (1999) traced to the twelfth-century scholar Maimonides. When enrollment in a grade passes 40, the grade splits into two classes. Predicted class size for enrollment e is
- e = 40: one class of 40. e = 41: two classes, 41/2 = 20.5 students each.
- e = 80: two classes of 40. e = 81: three classes of 27.
- e = 120: three classes of 40. e = 121: four classes of about 30.
Schools with 40 and 41 students in a grade are otherwise alike, yet their predicted class sizes differ by nearly half. Actual class sizes follow the rule only roughly, so Angrist and Lavy used the predicted size as an instrument: a fuzzy design. They found that smaller classes raised test scores of fourth and fifth graders, though not of third graders.
Close elections. In a U.S. House race, the running variable is the Democratic share of the two-party vote, and the cutoff is 50%. Lee (2008) found that a party that barely wins a seat is much more likely to win the next election in that district than a party that barely loses: a large incumbency advantage. He also checked the design’s logic: districts barely won and barely lost look alike on things decided before the election, such as the party’s past vote shares.
A regression discontinuity estimates the effect at the cutoff: for students who score about 50, not for students at 20 or 90. Tutoring might help strugglers much more, or not at all. A fuzzy RD is narrower still: the effect for compliers at the cutoff. This is the price of RD’s credibility. Extrapolating away from the cutoff needs extra assumptions, and you should say so when you do it.
A short history
The first RD. Psychologists Donald Thistlethwaite and Donald Campbell introduced the design in 1960 to study National Merit Scholarship certificates of merit, which were awarded to students above a test-score cutoff. They compared students just above and just below to see whether the recognition changed their later plans.
Quiet decades. The idea was well known in education research and evaluation but rarely used in economics for almost forty years.
The revival. In the late 1990s, economists rediscovered it: Angrist and Lavy’s class-size study (1999), Wilbert van der Klaauw’s study of college financial aid offers (2002), the identification results of Hahn, Todd and van der Klaauw (2001), and Lee’s elections paper (2008). A 2008 special issue of the Journal of Econometrics collected guides by Guido Imbens and Thomas Lemieux and McCrary’s density test, and Lee and Lemieux’s 2010 survey in the Journal of Economic Literature made the design standard.
Today. Work by Cattaneo, Calonico, Titiunik and coauthors on bandwidth choice, robust inference and local randomization turned RD into one of the most trusted designs for observational data.
Where it shows up
- Business. Loyalty programs give perks above a spending threshold; lenders approve loans above a credit-score cutoff; a store offers free shipping above $35. Each creates a cutoff, and comparing customers just above and below it measures what the perk does. Firms sometimes discover their own customers bunching just above a threshold, which is the density test in real life.
- Health policy. Most Americans become eligible for Medicare at 65. David Card, Carlos Dobkin and Nicole Maestas (2008) used that age cutoff to study how insurance coverage changes the use of health care.
- Alcohol and the law. Christopher Carpenter and Carlos Dobkin (2009) found that deaths among young Americans jump just after their 21st birthday, when drinking becomes legal, driven largely by car accidents and alcohol-related causes.
- Schools. Exam-school admission cutoffs, class-size caps, test-based retention and scholarship thresholds have all been studied this way.
- Daily life. Children born just after a school-entry birthday cutoff start school almost a year later than children born a day earlier, which researchers use to study the effects of age at school entry.
Practice
Local linear fits give 71.4 just above a cutoff and 68.9 just below. What is the RD estimate, and what does it estimate?
Show the answer
τ̂ = 71.4 − 68.9 = 2.5. In a sharp design, it estimates the average effect of the treatment for units at the cutoff, if average outcomes without treatment would have been continuous there.
Using Maimonides’ rule, what are the predicted class sizes for grade enrollments of 160 and 161?
Show the answer
160: ⌊159/40⌋ + 1 = 3 + 1 = 4 classes, 160/4 = 40. 161: ⌊160/40⌋ + 1 = 5 classes, 161/5 = 32.2. One extra student cuts the predicted class size by almost 8.
Two estimates of the same jump: with a bandwidth of 5 points, 7.1 (SE 3.0); with 25 points, 4.2 (SE 1.1). Which do you report?
Show the answer
Neither alone. The narrow estimate has little bias but a wide interval (about 1.2 to 13.0); the wide estimate is precise but could be biased if the curve bends. They are not far apart relative to the noise (the difference, 2.9, is about one standard error of the narrow estimate), so they don’t contradict each other. Report an MSE-optimal bandwidth with a robust bias-corrected interval, plus a plot of estimates over a range of bandwidths so readers see the trade-off.
In a fuzzy RD, take-up jumps from 10% to 40% at the cutoff and the outcome jumps by 1.5. Estimate the effect of treatment, and say for whom.
Show the answer
First stage 0.30; effect = 1.5 / 0.30 = 5.0. It is the local average treatment effect for compliers at the cutoff: units whose treatment status the cutoff changed. It says nothing directly about the 10% who take treatment either way, or the 60% who never do.
You run your RD on mother’s education, measured before treatment, and find a jump with t = 3.1 at the cutoff. What does it suggest, and what would you do?
Show the answer
A pre-determined variable can’t be affected by the treatment, so a jump means the units on the two sides differ: possibly sorting around the cutoff, or another policy at the same cutoff. Check the density for bunching, look at how the running variable is produced, try a donut RD without the units closest to the cutoff, and treat the main estimate with suspicion. (With many covariates, one rejection at 5% can be chance; check them jointly.)
Show that with a uniform kernel, the local linear RD estimate equals the coefficient τ in the OLS regression y = α + τ D + β(x − c) + γ D(x − c) + u on units with |x − c| < h.
Show the answer
For units below the cutoff (D = 0), the regression is α + β(x − c); above it, (α + τ) + (β + γ)(x − c). With the interactions, the parameters for the two sides are free of each other, so least squares fits a separate line to each side: α̂ = â− and α̂ + τ̂ = â+. So τ̂ = â+ − â−. (A triangular kernel gives the same result with weighted least squares.)
How the interactive works
The students. Scores are drawn from a normal distribution with mean 50 and spread 16, kept between 0 and 100. Next year’s score is f(x − 50) + τ·D + 4u + noise (spread 8), where u is motivation, unseen, and f is the curve you choose (the S-curve is 55 + 0.3x + 6 tanh(x/9)). The placebo covariate is 6 + 2.5u + 0.03x + noise. With manipulation m, each student between 44 and 50 is moved to between 50 and 53 with probability 2mΦ(u), so more motivated students move more often.
The estimates. Weighted least squares on each side with the kernel weights, the jump as the difference in intercepts, and heteroskedasticity-robust (HC1) standard errors as in the pooled regression with interactions. “Bias from the curve” refits the same estimator to the noise-free outcome at the same scores. The density test follows McCrary (2008): 2-point bins, local linear fits of the normalized bin counts with a triangular kernel and a 12-point bandwidth, and θ̂’s standard error √((1/nh)(24/5)(1/f̂+ + 1/f̂−)). The fuzzy estimate is local linear two-stage least squares with triangular weights.
What’s simplified. The intervals are the conventional ones, not robust bias-corrected; the bandwidth scan uses the known truth, which no real study has; the density test uses fixed bin and bandwidth choices instead of McCrary’s data-driven rules.
How it was checked (Node.js, before the page was built):
- The side-by-side fits reproduce the pooled weighted regression with the course library to six decimals, both estimate and HC1 standard error, for orders 0 to 4 and both kernels.
- S-curve, 1,000 students, 300 samples per bandwidth: bias 0.11 / 0.52 / 1.31 / 2.18 / 3.79 and SD 1.94 / 1.58 / 1.32 / 1.15 / 0.98 at bandwidths 8 / 12 / 18 / 25 / 50, so RMSE is lowest (1.67) near 12; the 95% intervals covered the truth 94–95% of the time at small bandwidths and 2% at 50. Flat lines (order 0) at 10 points: bias 5.85. Order 4 over the whole range: SE 2.07 vs 0.97 for a line.
- Density test, 500 samples without manipulation: rejected 5.0% of the time at the 5% level (5.3% with 3,000 students). With manipulation of 10% / 20% / 30%: 37% / 93% / 100%.
- Placebo covariate at a 10-point bandwidth: rejected 5.0% of the time without manipulation, 71% with 30% manipulation, when the outcome estimate was 2.6 points too high (0.4 of that from the curve, the rest from the sorting).
- Fuzzy RD: the IV estimate equals the ratio of the two jumps and the shared library’s 2SLS (3.916351 all three ways). Over 300 samples with a take-up jump of 0.5: median 4.91 for a truth of 5, coverage 94%, while the takers-vs-others comparison averaged 11.9. With a jump of 0.08, the middle half of the estimates ran from −6.3 to 15.9.
Check yourself
What is the key assumption behind a sharp regression discontinuity?
Show the answer
Continuity of the potential outcomes at the cutoff. Then any jump in the observed average must come from the treatment.
Why is local linear regression preferred to comparing averages in a window on each side?
Show the answer
Window averages compare units at, say, 45 and 55. If the outcome rises with the score, that difference is partly slope. A line on each side extrapolates to the cutoff itself.
The density test finds far more people just above the cutoff than just below. What does that suggest?
Show the answer
Bunching means some people controlled which side they landed on, breaking the local-randomization argument. Those who sort may differ in ways that also affect the outcome.
At a cutoff, take-up of a program rises by 25 percentage points and the outcome rises by 2. What is the fuzzy RD estimate?
Show the answer
Reduced form ÷ first stage = 2 ÷ 0.25 = 8: the effect for compliers at the cutoff.
What happens when you widen the bandwidth?
Show the answer
More units means less noise; but units farther from the cutoff make a line a worse local approximation. The MSE-optimal bandwidth balances the two.
Sources
- J. D. Angrist and J.-S. Pischke, Mostly Harmless Econometrics (Princeton, 2009), chapter 6 (regression discontinuity designs); and Mastering ’Metrics (Princeton, 2015), chapter 4.
- M. D. Cattaneo, N. Idrobo and R. Titiunik, A Practical Introduction to Regression Discontinuity Designs: Foundations (Cambridge University Press, 2020).
- D. L. Thistlethwaite and D. T. Campbell, Regression-discontinuity analysis: an alternative to the ex post facto experiment, Journal of Educational Psychology 51(6), 309–317 (1960).
- J. Hahn, P. Todd and W. van der Klaauw, Identification and estimation of treatment effects with a regression-discontinuity design, Econometrica 69(1), 201–209 (2001).
- J. D. Angrist and V. Lavy, Using Maimonides’ rule to estimate the effect of class size on scholastic achievement, Quarterly Journal of Economics 114(2), 533–575 (1999).
- D. S. Lee, Randomized experiments from non-random selection in U.S. House elections, Journal of Econometrics 142(2), 675–697 (2008).
- J. McCrary, Manipulation of the running variable in the regression discontinuity design: a density test, Journal of Econometrics 142(2), 698–714 (2008).
- G. W. Imbens and T. Lemieux, Regression discontinuity designs: a guide to practice, Journal of Econometrics 142(2), 615–635 (2008); D. S. Lee and T. Lemieux, Regression discontinuity designs in economics, Journal of Economic Literature 48(2), 281–355 (2010).
- G. Imbens and K. Kalyanaraman, Optimal bandwidth choice for the regression discontinuity estimator, Review of Economic Studies 79(3), 933–959 (2012); S. Calonico, M. D. Cattaneo and R. Titiunik, Robust nonparametric confidence intervals for regression-discontinuity designs, Econometrica 82(6), 2295–2326 (2014).
- A. Gelman and G. Imbens, Why high-order polynomials should not be used in regression discontinuity designs, Journal of Business & Economic Statistics 37(3), 447–456 (2019).
- D. Card, C. Dobkin and N. Maestas, The impact of nearly universal insurance coverage on health care utilization: evidence from Medicare, American Economic Review 98(5), 2242–2258 (2008); C. Carpenter and C. Dobkin, The effect of alcohol consumption on mortality: regression discontinuity evidence from the minimum drinking age, American Economic Journal: Applied Economics 1(1), 164–182 (2009).
- Wikipedia (secondary): Regression discontinuity design.