๐ Core Idea: Both Difference-in-Differences (DiD) and Regression Discontinuity (RD) are powerful quasi-experimental methods used to estimate causal effects. DiD compares changes over time between a treated and a control group, while RD exploits a sharp cutoff in a continuous variable to mimic a randomized experiment.
What is Difference-in-Differences (DiD)?
Difference-in-Differences is a statistical technique used to estimate the causal effect of a treatment or policy by comparing the change in outcomes over time between a group that received the treatment (the treatment group) and a group that did not (the control group). Its power relies on the parallel trends assumption: in the absence of treatment, the outcomes for both groups would have followed the same trend.
A state raises its minimum wage in 2025 (treatment). A neighboring state does not (control). You collect employment data for both states for 2024 (pre-treatment) and 2026 (post-treatment). The DiD estimator compares the change in employment in the treated state to the change in employment in the control state.
A school district introduces a new tutoring program in 2024 for 5th graders. You compare test score gains from 2023 to 2025 for these 5th graders (treatment group) against test score gains for 5th graders in a similar district without the program (control group).
โ ๏ธ Key Pitfalls in DiD
- Violation of Parallel Trends: If the treatment and control groups were on different trajectories even without the policy, the DiD estimate will be biased. Always check pre-treatment trends visually and statistically.
- Anticipation Effects: If agents (like firms or individuals) change behavior before the policy takes effect, the "pre-treatment" period is contaminated.
- Spillovers/General Equilibrium Effects: The treatment might affect the control group (e.g., workers moving from the control state to the treated state), violating the Stable Unit Treatment Value Assumption (SUTVA).
What is Regression Discontinuity (RD)?
Regression Discontinuity is a method that identifies causal effects by exploiting a precise cutoff or threshold on a continuous "running" variable. Units just above and just below the cutoff are assumed to be nearly identical except for their treatment status, creating a local randomized experiment.
A university grants a merit-based scholarship to all applicants with a test score of 90 or above. You compare the college graduation rates of students who scored 89.9 (just below the cutoff, no scholarship) with those who scored 90.1 (just above the cutoff, scholarship).
A policy mandates that any school with enrollment of 40 or more students gets an extra teacher. You compare academic outcomes for schools with enrollment of 39.9 (just under, no extra teacher) versus 40.1 (just over, gets an extra teacher).
โ ๏ธ Key Pitfalls in RD
- Manipulation of the Running Variable: If individuals can precisely control their score near the cutoff (e.g., retaking a test), it breaks the "as-good-as-random" assignment. McCrary density tests can check for this.
- Incorrect Bandwidth Selection: Using data too far from the cutoff introduces bias from underlying trends; using too narrow a bandwidth increases variance. Cross-validation is crucial.
- External Validity (Lack of): RD estimates are only valid locally at the cutoff. They tell you the effect for units right at the threshold, not for all treated units.
DiD vs. RD: Direct Comparison
| Feature | Difference-in-Differences (DiD) | Regression Discontinuity (RD) |
|---|---|---|
| Core Identifying Variation | Time (Before/After) & Group (Treated/Control) | Discontinuity at a cutoff on a continuous variable |
| Key Assumption | Parallel Trends | Continuity of potential outcomes at the cutoff |
| Data Requirement | Panel or repeated cross-section data (pre & post) | Cross-sectional data around a sharp cutoff |
| Treatment Assignment | Often not random (e.g., policy roll-out) | As-good-as-random locally at the cutoff |
| Scope of Inference | Average effect on the treated (ATT) | Local Average Treatment Effect (LATE) at the cutoff |
| Best Used When... | A policy affects a well-defined group at a specific time. | A rule creates a sharp, exogenous threshold for treatment. |
When to Choose DiD or RD?
The choice between DiD and RD depends entirely on your research design and the nature of your treatment assignment.
- Choose DiD when you have a clear before-and-after period and can identify a comparable control group that did not receive the treatment. It's ideal for policy evaluations like a new law, marketing campaign, or program introduction.
- Choose RD when treatment assignment is determined by a clear, sharp cutoff on a measurable variable (like a test score, age, or income). It's the "gold standard" for causal inference when such a cutoff exists, as it convincingly mimics randomization.
Final Verdict: If you have time variation and a control group, use DiD. If you have a sharp cutoff rule, use RD. In some complex cases, researchers even combine both methods in a Regression Discontinuity Difference-in-Differences (RDDiD) design for even stronger identification.