Day 73. Sharp Regression Discontinuity
When treatment switches on at a known threshold of a running variable, units just above and just below are comparable. The jump in the outcome at the cutoff identifies the effect there, under one assumption: potential outcomes are continuous in the running variable.
- ●Define the sharp RD estimand and state the continuity assumption.
- ●Estimate the jump with separate linear fits on each side and explain why a raw difference in means is biased.
- ●Prove identification and explain why the effect is local to the cutoff.
- ●Apply RD to drinking age, incumbency, scholarships and Medicare eligibility.
Theory
Design
A running variable (age, test score, vote margin, income) determines treatment by a rule: . There is no overlap: every unit with is treated and every unit below is not. Units cannot be compared at the same , but they can be compared arbitrarily close to .
Estimand and assumption
Continuity: and are continuous at . Then
Continuity fails if something else also changes at the cutoff (another policy at age 21), or if units manipulate to land on the desired side (Day 77).
Estimation
Fit separately on each side near and take the difference of the two fitted values at . The standard choice is local linear regression within a bandwidth (Days 74–75):
A raw difference in means within is biased whenever has a slope; high-order global polynomials fitted to the whole range give erratic estimates and should be avoided (Gelman and Imbens).
What RD identifies
The effect for units at the cutoff, an extreme form of locality. Away from the data say nothing without further assumptions. Heterogeneity in effects along can be studied only with extrapolation or multiple cutoffs.
Two views
- Continuity: limits of conditional expectations, estimated by local polynomials.
- Local randomisation: within a small window, treatment is as good as random (for instance when includes a random component that units cannot control precisely); analyse as an experiment.
Part 1 · Warm-up
Exercise 1 · A jump
At the cutoff, the fitted line from the left reaches 90 and the fitted line from the right starts at 98. Estimate the effect.
Show solution
Step 1. .
Exercise 2 · Find the design
Name the running variable, cutoff and treatment: (a) Medicare eligibility; (b) a merit scholarship; (c) the effect of being the incumbent party; (d) a class-size cap of 40 pupils.
Show solution
Step 1. (a) Age, 65, Medicare coverage.
Step 2. (b) Exam score, the qualifying score, receiving the scholarship.
Step 3. (c) Vote margin in the previous election, 0, holding the seat.
Step 4. (d) Enrolment, 41 (and 81, ...), being split into smaller classes (fuzzy in practice, Day 76).
Exercise 3 · Separate lines
Left of the cutoff the fitted line is ; right of it, . Estimate the effect and say whether the effect varies with .
Show solution
Step 1. At : .
Step 2. The slopes differ, but RD identifies only the jump at ; the difference in slopes does not reveal how the effect varies away from without extra assumptions.
Exercise 4 · Bias of a difference in means
, with uniform near . What does the difference in means between and estimate?
Show solution
Step 1. Right mean: . Left mean: .
Step 2. Difference: .
Answer: biased by ; with slope 2 and , by 2. Local linear fits remove this bias.
Exercise 5 · Local effect
An RD at a scholarship cutoff finds an effect on college completion of 10 points. Does a policy lowering the cutoff by 50 points have the same effect?
Show solution
Step 1. The estimate applies to students scoring at the current cutoff.
Step 2. Students 50 points lower may benefit more (or less); the design does not tell us.
Answer: not necessarily; extrapolation needs assumptions or other evidence.
Part 2 · Proofs
Exercise 6 · Identification
Prove under continuity.
Show solution
Step 1. For , ; for , .
Step 2. By continuity, and .
Step 3. Subtract.
Exercise 7 · The general bias of a window comparison
Let be differentiable with slope at and uniform near . Show that, to first order, the window difference in means is .
Show solution
Step 1. Right mean ; left mean .
Step 2. Subtract: .
Exercise 8 · Separate regressions
Show that the pooled regression within the window gives the same as fitting separate lines on each side and differencing their intercepts at .
Show solution
Step 1. The pooled regression has a separate intercept and slope for each side ( left; right).
Step 2. With no shared parameters, the least-squares problem splits into two separate problems.
Step 3. is the difference of the two fitted intercepts at .
Exercise 9 · No extrapolation without assumptions
Construct two models consistent with the same observed but with different effects at .
Show solution
Step 1. Observed: for and for .
Step 2. Model A: everywhere, : effect 5 at all .
Step 3. Model B: for and for (unobserved there); : effect , which is 3 at .
Answer: both match the data; is never observed right of .
Exercise 10 · Covariates do not change the estimand
Let be a pre-treatment covariate with continuous at . Explain why adding linearly to the local linear regression leaves the estimand unchanged (in large samples) but can reduce variance.
Show solution
Step 1. Including changes by its coefficient times the jump in at (FWL).
Step 2. Continuity of makes that jump zero in the limit.
Step 3. explains outcome variance, shrinking residuals and the standard error.
Answer: same estimand, possibly more precision; a jump in would instead signal a violation (Day 77).
Part 3 · Applied
Exercise 11 · The minimum legal drinking age
Mortality of young adults (deaths per 100,000 person-years) approaches 94 from below age 21 and 103 from above. Estimate the effect of legal access to alcohol and state the key assumption.
Show solution
Step 1. deaths per 100,000, about 9.6%.
Step 2. Assumption: nothing else that affects mortality changes discontinuously at 21.
Answer: about 9 extra deaths per 100,000 (mostly motor-vehicle accidents and suicides in studies of this design); only age-21-specific changes (for example, casino access in some states) would threaten it.
Exercise 12 · The incumbency advantage
In US House elections, the Democratic vote share in the next election approaches 0.47 for districts where Democrats lost narrowly and 0.55 where they won narrowly. Estimate and interpret.
Show solution
Step 1. .
Step 2. Bare winners and bare losers are similar; winning confers incumbency.
Answer: incumbency raises the next-election vote share by about 8 points for marginal seats.
Exercise 13 · A merit scholarship
College enrolment approaches 0.60 just below the qualifying score and 0.68 just above. Estimate the effect, and say for whom.
Show solution
Step 1. .
Answer: an 8-point rise in enrolment for students scoring at the threshold, typically above-average students; effects for students far below the threshold are not identified.
Exercise 14 · Medicare at 65
Insurance coverage rises from 88% to 97% at age 65, and hospital admissions jump by 8%. Is this a sharp RD for "having insurance"? What can be estimated?
Show solution
Step 1. Medicare eligibility is sharp at 65, but insurance coverage jumps only from 88% to 97%: for coverage, the design is fuzzy.
Step 2. The sharp RD estimates the effect of eligibility (reaching 65) on admissions: +8%.
Answer: the effect of insurance itself requires scaling by the jump in coverage (Day 76), and must account for changes in the type of coverage (secondary insurance), not just its presence.
Exercise 15 · Global polynomials
In the simulation below, compare the local linear estimate within a bandwidth with a global fourth-order polynomial and with a raw window difference in means. Which behaves badly and why?
Show solution
Step 1. The local linear estimate is close to the true jump on average.
Step 2. The window difference in means is biased by the slope (Exercise 4).
Step 3. The global quartic is roughly unbiased here but noisier (SD about 1.0 versus 0.7): it puts large weight on observations far from the cutoff and is sensitive to the polynomial order.
Answer: prefer local linear (or local quadratic) fits with a data-driven bandwidth (Day 75).
Verify in Python
import numpy as np
rng = np.random.default_rng(73)
c, tau = 0.0, 5.0
mu0 = lambda x: 50 + 8 * x + 6 * x ** 2 - 4 * x ** 3 # smooth untreated outcome
def sample(n=1000):
x = rng.uniform(-1, 1, n); y = mu0(x) + tau * (x >= c) + rng.normal(0, 3, n)
return x, y
def local_linear(x, y, h):
m = np.abs(x - c) <= h; d = (x >= c).astype(float)
X = np.column_stack([np.ones(m.sum()), d[m], x[m] - c, d[m] * (x[m] - c)])
return np.linalg.lstsq(X, y[m], rcond=None)[0][1]
def window_means(x, y, h):
return y[(x >= c) & (x <= c + h)].mean() - y[(x < c) & (x >= c - h)].mean()
def global_poly(x, y, p=4):
d = (x >= c).astype(float)
X = np.column_stack([np.ones_like(x), d] + [x ** k for k in range(1, p + 1)] + [d * x ** k for k in range(1, p + 1)])
return np.linalg.lstsq(X, y, rcond=None)[0][1]
res = {"local linear h=0.3": [], "window means h=0.3": [], "global quartic": []}
for _ in range(1000):
x, y = sample()
res["local linear h=0.3"].append(local_linear(x, y, .3))
res["window means h=0.3"].append(window_means(x, y, .3))
res["global quartic"].append(global_poly(x, y))
for k, v in res.items():
print(f"{k:20s} mean {np.mean(v):6.2f} sd {np.std(v):5.2f} (truth {tau})")
print("Ex 4 bias s*h:", 2 * 1, " | Ex 11:", 103 - 94, f"({(103 - 94) / 94:.1%})")
Key takeaways
- Sharp RD identifies the effect at the cutoff as the jump in , assuming potential outcomes are continuous there.
- Estimate with local linear fits on each side; raw window means are biased by the slope, global polynomials are fragile.
- The effect is local; extrapolating away from the cutoff needs extra assumptions.
Simulation Lab: Sharp Regression Discontinuity
Open full screen →Local linear fits versus window means and global polynomials at a scholarship cutoff.
Scholarship-style data: treatment switches on at x = 0. Local linear fits within the bandwidth (left and right) estimate the jump; a raw comparison of means inside the window is biased by the slope; global fourth-order polynomials use the whole range and are noisier. The true jump is set by the slider.