- Introduced by
- Card & Krueger (canonical 1994 application); Angrist & Pischke (textbook treatment)
- Year
- 1994
- Type
- Causal inference / panel regression
What does it do?
Difference-in-Differences is a causal-inference method that estimates the effect of an intervention by comparing how a treatment group and a control group change over time.
Card and Krueger's 1994 minimum-wage study is its canonical application, and Angrist and Pischke's Mostly Harmless Econometrics gives a textbook treatment. The estimate is the difference between the two groups' before-and-after changes.
The intuition behind the method
Suppose one group receives a policy or treatment and another does not. Both groups may have been trending in some direction anyway, so simply comparing their before-and-after values is misleading. DiD first measures how much each group changed on its own, then subtracts the control group's change from the treatment group's change. The leftover movement is attributed to the intervention only if the two groups would have changed in parallel without it, because the control group's change is used as a stand-in for the treated group's counterfactual change.
History
Difference-in-Differences became widely used in applied economics through Card and Krueger's 1994 study of fast-food employment after a New Jersey minimum-wage increase, which used neighbouring Pennsylvania as a control. Angrist and Pischke's Mostly Harmless Econometrics presents the method as an identification strategy for empirical practice, setting out its assumptions and interpretation.
When to use it
Choose DiD when a policy, programme or other intervention affects some units but not others, and outcomes are observed for both groups in at least two periods, before and after the intervention. The data can be a panel that follows the same units over time or repeated cross-sections, and the outcome can be continuous or binary, although binary outcomes need the care described under limitations. The central requirement is the parallel-trends assumption: absent the intervention, the two groups would have changed in parallel. Do not use it with a single period, where differencing over time is impossible, or when the groups were already on diverging paths before the intervention. It is also a poor fit when no credible comparison group was unaffected by the intervention. The design described on this page is the canonical two-group, two-period case; staggered treatment timing requires the extensions noted under limitations.
Limitations and considerations
- The estimate rests on parallel trends; if the groups were already diverging, the estimate is biased and the causal reading fails. Parallel pre-treatment trends are supporting evidence, but they cannot confirm what the trends would have been after the intervention.
- Requires observations in at least two time periods; a single cross-section cannot support the difference of differences.
- With only a few units per group, the group means are imprecise and the standard errors are unreliable.
- Binary outcomes need care. With a linear probability model, β₃ is a difference in probabilities and can be read directly as the ATT on the probability scale. With nonlinear models such as logit or probit, the interaction coefficient is not the effect on the probability scale, so the ATT must be computed separately, for example by comparing predicted probabilities with and without treatment for the treated units. β₃ alone should not be reported as the effect in that case.
- With more than two periods or staggered treatment timing, the basic regression with a single interaction term, estimated by two-way fixed effects, can be biased when treatment effects differ across cohorts or change over time. Heterogeneity-robust estimators are then needed; the design described on this page is the canonical two-group, two-period case only.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Can estimate a causal effect from observational data without randomisation, by differencing out fixed group differences and common time shocks, provided parallel trends hold.
- Simple to estimate and interpret: in the basic design the treatment effect is a single interaction coefficient.
- Time-invariant differences between the groups that affect their levels cancel in the differencing, so they do not need to be measured, provided they do not also change the trend.
Applications
- Evaluating the employment or wage effects of a minimum-wage or labour-market policy change.
- Measuring the causal impact of a programme, reform, or regulation that reaches some units but not others.
- Assessing health, education, or business outcomes before and after a treatment using a comparable untreated group.
How it works
How it works
The outcome y for unit i at time t is regressed on a treatment indicator (which group), a post-period indicator (before or after), and their interaction. The interaction term captures the part of the change that is unique to the treatment group in the post period.
Formula
y_{it} = \beta_0 + \beta_1\,\text{Treat}_i + \beta_2\,\text{Post}_t + \beta_3\,(\text{Treat}_i \times \text{Post}_t) + \varepsilon_{it}The DiD estimate of the average treatment effect on the treated (ATT) is the interaction coefficient β₃, read as the ATT within the linear specification above. In the simple two-group, two-period case without covariates, this equals the treatment group's before-after change minus the control group's before-after change. The difference of differences removes any fixed group gap and any common time trend.
Formula
\hat{\tau}_{ATT} = \hat{\beta}_3 = (\bar{y}_{T,1} - \bar{y}_{T,0}) - (\bar{y}_{C,1} - \bar{y}_{C,0})Common pitfalls
- Reporting a DiD estimate without examining pre-intervention trends in both groups; a visibly divergent pre-trend means the design is not credible as it stands.
- Applying DiD to a single period (T = 1), where differencing over time is impossible; a cross-sectional method is needed instead.
- Working with very few units per group, which makes the group means noisy and inflates standard errors.
- Treating a significant interaction as causal while ignoring concurrent shocks that hit only one group.
- Using conventional standard errors when outcomes are serially correlated within units or treatment is assigned at group level. Standard errors should usually be clustered at the level of treatment assignment, and with few clusters a wild cluster bootstrap or similar small-sample correction should be considered. Ignoring serial correlation typically understates the standard errors and overstates precision.
Frequently asked questions
What is the parallel-trends assumption?
It states that, absent the intervention, the treatment and control groups would have followed the same trend over time. DiD relies on this so that the control group's change validly stands in for what the treatment group would have experienced without treatment. Checking that pre-treatment trends were parallel is the usual support for it, but it is supporting evidence rather than proof.
Which coefficient is the treatment effect?
The interaction term between the treatment indicator and the post-period indicator. In the linear model shown on this page, its coefficient β₃ is the difference-in-differences estimate of the average treatment effect on the treated (ATT). For nonlinear models of binary outcomes, see the limitations section.
How many periods and observations do I need?
At least two periods (before and after) are essential, since the method differences over time. A single period cannot identify the effect. Groups with very few units give imprecise means and unreliable standard errors, so the sample should be large enough for the group means and their variance to be estimated with reasonable precision.
What if parallel trends do not hold?
Then the DiD estimate is biased and the causal reading is invalid. The design should be reconsidered, and other identification strategies, such as those in the related methods, may be more appropriate; they rest on different assumptions.
Related methods
Sources
Angrist, J. D., & Pischke, J.-S. (2009). Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press.
ISBN: 978-0691120355Card, D., & Krueger, A. B. (1994). Minimum Wages and Employment: A Case Study of the Fast-Food Industry in New Jersey and Pennsylvania. American Economic Review, 84(4), 772-793.
Open publication reference