Difference-in-Differences Design¶
Method — instantiates Time Series Cross-Section Analysis
Compares differential before-after change between exposed and comparison units.
A difference-in-differences design estimates an effect as a double difference. Take the before-to-after change in the group that was exposed to some event or policy; take the before-to-after change in a comparison group that was not, over the very same window; then subtract the second from the first. The comparison group's change is the counterfactual — the best estimate of what the exposed group would have done had nothing happened to it — so the whole design rests on a single load-bearing assumption: that absent the exposure, the two groups' outcomes would have moved in parallel. Its defining commitment, and what separates it from a controls-based regression, is that a level gap between the groups is permitted and irrelevant; only the divergence in their changes is read as effect. It does not care that the treated group started higher or lower — it cares only that the two lines, once one was intervened upon, stopped moving together.
Example¶
A state raises its cigarette excise tax at the start of a year. A naive before/after would credit the tax with the drop in per-capita cigarette sales that follows — but sales were sliding nationwide anyway. The analyst instead builds a two-by-two frame: the taxing state and three neighboring states that did not change their tax, each measured for two years before and two years after. In the taxing state, per-capita sales fall by roughly a tenth; in the untaxed neighbors they fall by about a twenty-fifth over the same span, a shared secular decline. The double difference — the taxing state's larger drop minus the neighbors' background drop — is the slice attributable to the tax. Before trusting it, the analyst checks that the four states' sales were drifting in parallel before the tax; if the neighbors are a good counterfactual, they should have been. The conclusion is stated as an effect net of the common trend, not as the raw before/after fall the headline would have reported.
How it works¶
- Lay out the two-by-two. Group (exposed / comparison) crossed with period (before / after); the estimand is the interaction of the two.
- Take the double difference. Exposed group's change minus comparison group's change; equivalently, the coefficient on an exposure×after indicator.
- Defend parallel trends. Inspect pre-exposure periods to show the two groups moved together before the intervention, and run placebo "effects" in periods where none should exist.
Tuning parameters¶
- Comparison-group choice — which unexposed units stand in as the counterfactual. A closer match makes parallel trends more credible but shrinks the pool; a broad pool risks importing units on different trajectories.
- Pre-period window — how many periods before the exposure are used to test parallel trends. Longer is more convincing but more likely to include its own disruptions.
- Single vs. staggered timing — one common exposure date, or units treated at different times. Staggered rollouts demand estimators that avoid contaminated comparisons among already-treated units.
- Outcome scale — levels or logs; the choice changes whether "parallel" means equal absolute or equal proportional change.
When it helps, and when it misleads¶
Its strength is that it neutralizes any confounder shared by both groups — a national trend, a common season, an economy-wide shock — by letting the comparison group absorb it, and it does so without needing to measure that confounder. The failure mode is that its one assumption is fundamentally untestable for the period that matters: parallel trends can be checked before the exposure but only assumed after. A classic way it breaks is Ashenfelter's dip — the exposed group is often selected precisely because its outcome dipped just beforehand, so it was already rebounding, and the design credits the intervention with a recovery that would have happened anyway.[1] A poorly chosen comparison group is the other frequent misuse: pick units on a divergent path and the "effect" is just their pre-existing drift. The guarding discipline is to show parallel pre-trends explicitly and to run placebo tests before reporting the double difference as causal.
How it implements the components¶
within_unit_change_contrast— it computes each group's own before-to-after change, the first of the two differences.between_unit_difference_contrast— it subtracts one group's change from the other's, reading effect from the gap in those changes.counterfactual_peer_set— the unexposed comparison group is the explicit counterfactual for the exposed group's untreated path.
It does not model or absorb baselines and shocks as regression terms: it does not implement stable_unit_baseline_control or common_time_context_control — that is fixed_effects_panel_model, which soaks those up with intercepts, whereas this design tolerates a fixed level gap and lets the comparison group difference the common shock away. Nor does it estimate a lagged_effect_window — that is lagged_panel_regression.
Related¶
- Instantiates: Time Series Cross-Section Analysis — it supplies the archetype's difference-in-change contrast against an explicit counterfactual.
- Consumes: fixed_effects_panel_model — the double difference is commonly estimated as a two-way fixed-effects regression with an exposure×after term.
- Sibling mechanisms: fixed_effects_panel_model · event_study_panel_plot · unit_time_dashboard · lagged_panel_regression · balanced_panel_completeness_check · peer_trajectory_benchmarking
Editorial Notes¶
Form Classification¶
Form family: Analysis, Modeling & Optimization
Rationale: Difference-in-Differences Design operates as a computation, comparison, model, or analytic representation used to infer, estimate, or choose because it compares differential before-after change between exposed and comparison units.
Independent corroboration: The frozen evidence defines Difference-in-Differences Design as 'Compares differential before-after change between exposed and comparison units', so its operative form is Analysis, Modeling & Optimization.
Review outcome: Independent reviewer agreement; high confidence.
Origin Attribution¶
Primary origin: Economics & Finance
Origin pattern: Cross-disciplinary synthesis
Present-day reach: Multi-domain
Rationale: Econometrics established difference-in-differences for estimating policy or treatment effects from differential before-after change under parallel trends.
Related originating lineages:
- Statistics & Experimental Design — Causal-inference statistics formalized identification assumptions, uncertainty estimation, and diagnostics for pretrend violations.
Review resolution: Econometrics established difference-in-differences for estimating policy or treatment effects from differential before-after change under parallel trends. Econometric program evaluation and statistical causal inference jointly formed difference-in-differences; public policy is a major use, not a distinct origin.
Review outcome: Reconciled after independent review; high confidence.
References¶
[1] The parallel-trends assumption requires that, absent the intervention, exposed and comparison groups would have changed by the same amount. Ashenfelter's dip (Orley Ashenfelter, 1978) is the canonical violation: units selected for treatment often experience a temporary pre-treatment decline, so their subsequent rebound inflates the estimated effect. withdrawn registry ↩