Difference-in-
Differences
Learn how to measure the causal effect of a policy or intervention by comparing treatment and control groups across time.
What Is Difference-in-Differences?
Difference-in-Differences (DiD) is a statistical technique used to estimate the causal effect of a treatment, policy, or intervention. It compares how an outcome changes over time between a group that receives the treatment and a group that does not.
Two Key Groups
Why DiD Matters in Business
The DiD Formula
The first difference \( (\bar{Y}_{T,\text{after}} - \bar{Y}_{T,\text{before}}) \) captures the change in the treatment group. The second difference \( (\bar{Y}_{C,\text{after}} - \bar{Y}_{C,\text{before}}) \) captures background trends. Subtracting the second from the first isolates the treatment effect.
Visualizing the DiD Logic
The Parallel Trends Assumption
DiD relies on a critical assumption: in the absence of treatment, the treatment and control groups would have followed the same trend over time. This is called the parallel trends assumption.
DiD vs. Simple Before/After
| Simple Before/After | Difference-in-Differences | |
|---|---|---|
| Comparison | Same group, two time periods | Two groups, two time periods |
| Controls for Trends? | No | Yes |
| Accounts for Shocks? | No | Yes (if shared) |
| Key Assumption | Nothing else changed | Parallel pre-trends |
| Reliability | Low: confounded by time | Higher: isolates treatment |
How to Apply DiD: Step by Step
Example 1: The 2 × 2 Table
A company launches a loyalty program in Store A (treatment) but not Store B (control). Average monthly revenue ($000s):
| Before | After | Change | |
|---|---|---|---|
| Store A (Treatment) | $120 | $160 | +$40 |
| Store B (Control) | $110 | $125 | +$15 |
Example 2: Visualizing the Numbers
Example 3: The Regression Approach
In practice, DiD is often estimated using a regression equation:
Interpreting \( \beta_3 \): The Interaction Term
When DiD Can Fail
Common Mistakes
Question 1 of 5
What does the Difference-in-Differences method primarily estimate?
Question 2 of 5
A treatment group's outcome rises from 50 to 80, and a control group's outcome rises from 45 to 60. What is the DiD estimate?
Question 3 of 5
What is the key assumption required for Difference-in-Differences to produce an unbiased estimate?
Question 4 of 5
In the regression \( Y_{it} = \beta_0 + \beta_1 \cdot \text{Treat}_i + \beta_2 \cdot \text{Post}_t + \beta_3 \cdot (\text{Treat}_i \times \text{Post}_t) + \varepsilon_{it} \), which coefficient represents the DiD estimate?
Question 5 of 5
A researcher finds that before a new ad campaign, both cities had rising sales, but City A (treatment) was rising faster than City B (control). If she applies DiD, the estimate will be: