Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 37 ยท Instrumental Variables and DiD

Regression Discontinuity

Learn regression discontinuity design: sharp cutoffs, local linear regression, bandwidth choice, validity checks such as manipulation and covariate smoothness, and fuzzy designs.

Scholarships go to students who score at least 80. A drug is prescribed when blood pressure exceeds a threshold. Loans are approved above a credit score. Whenever a rule assigns treatment based on a number crossing a cutoff, there is a natural experiment hiding at the cutoff: a student with 79.9 and one with 80.1 are practically identical, yet one gets the treatment.

Regression discontinuity design (RDD) compares outcomes just below and just above the threshold. If the outcome jumps there, and nothing else changes sharply at that point, the jump is the causal effect of the treatment for units at the cutoff.

Setup

  • Running variable X: the score that decides assignment (also called the forcing variable).
  • Cutoff c.
  • Sharp RD: treatment is exactly D = 1 if X >= c. In a fuzzy RD the cutoff only changes the probability of treatment, and you handle it like an instrument (see below).

The key assumption is continuity: without treatment, the expected outcome would be a smooth function of X at the cutoff. Units cannot precisely control which side of c they land on.

A naive and a local estimate

Why not compare all treated to all untreated units? Because the outcome also depends on X, so units far from the cutoff differ systematically. RDD instead fits a line on each side of the cutoff within a bandwidth h and takes the gap between the two lines at c.

Python Sharp RD with local linear regression

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The naive comparison is far off because of the slope in X. The local linear estimates hover around 1.5. The design matrix has an intercept, the treatment dummy (the jump), the slope on the left and a slope change on the right, so each side gets its own line.

Bandwidth: a bias-variance trade-off

A narrow bandwidth keeps only units that are truly comparable (low bias) but few (high variance). A wide one uses more data but relies on the line fitting well far from the cutoff. Data-driven rules such as the Imbens-Kalyanaram or the Calonico-Cattaneo-Titiunik (CCT) optimal bandwidth are standard; in Python the rdrobust package implements them. Always show results for several bandwidths, as the loop above does, and prefer local linear over high-order global polynomials, which can behave wildly near the boundary.

Python Curved relationship: why the bandwidth matters

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

With h = 1 the straight line misses the curvature and the estimate drifts from 1.0. As the bandwidth shrinks, the curve looks locally straight and the estimate stabilizes (and gets noisier).

Validity checks

flowchart TD
    A["Is there a jump in the outcome?"] --> B["Manipulation test: is the density of X smooth at the cutoff?"]
    B --> C["Covariate smoothness: pre-treatment variables should not jump"]
    C --> D["Vary the bandwidth and the polynomial order"]
    D --> E["Placebo cutoffs where nothing should happen"]

Evidence that units cannot sort themselves across the cutoff.

  • Manipulation of the running variable. If students can retake the test until they pass or officials round scores up, people just above the line differ from people just below. Look for a spike in the density of X at the cutoff (the McCrary or rddensity test) and ask how the score is produced.
  • Covariate balance. Predetermined covariates (age, earlier scores) should show no jump at c.
  • Placebo cutoffs. Estimate "effects" at points where no rule exists; they should be near zero.
  • Donut RD. Drop observations very close to the cutoff to check sensitivity to manipulation.

Fuzzy RD and what you learn

When crossing the cutoff only raises the chance of treatment (some people below still get it, some above skip it), the cutoff acts as an instrument. The fuzzy estimate is the jump in the outcome divided by the jump in the treatment rate at c: a Wald estimator, local to the cutoff.

RDD effects are local: they apply to units near the threshold. The scholarship's effect for a student scoring 80 says little about a student scoring 95. That limitation is the price of an unusually credible design.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the core identifying assumption of RDD?

    If the outcome would be smooth at c, any jump at c is attributable to the treatment.
  2. 2. Why is a narrow bandwidth riskier in terms of variance?

    Narrow windows give comparable units but few of them, so estimates are noisier.
  3. 3. Students can retake an exam until they reach the passing score. What is the concern?

    Sorting around the cutoff breaks the idea that units on either side are comparable.
  4. 4. A fuzzy RD estimate equals:

    It is an IV (Wald) estimate using the cutoff as the instrument.

Summary

  • RDD uses a cutoff rule: units just on either side are comparable.
  • Estimate with local linear regression on each side; show several bandwidths.
  • Check for manipulation, covariate jumps and placebo cutoffs.
  • Fuzzy designs divide the outcome jump by the treatment-probability jump.
  • The estimate is local to units near the cutoff.

Next: Synthetic Control