Some of the cleanest causal evidence in economics comes from a simple move: compare the change in a group a policy hit to the change in a group it missed. That is difference-in-differences — it turns a law that lands in one place but not another into something close to a natural experiment. It is one of the first quasi-experimental designs Columbia students meet, and this page builds it from the four cell means up.
1 · Two differences, and why one alone misleads
You want the causal effect of a policy on an outcome Y. You have two groups — a treated group that got the policy and a control group that did not — each observed before and after.
Two obvious comparisons both fail. Compare the treated group before and after, and you credit the policy with whatever else changed over that period — the business cycle, a national trend. Compare the treated and control groups after the policy, and you credit it with whatever made the two groups differ in the first place — different regions, industries, histories.
Difference-in-differences takes both differences and subtracts one from the other. The common time trend cancels. The fixed gap between the groups cancels. What survives is the treated group’s extra movement — the part no trend and no fixed difference can explain.
2 · The 2×2 table
Line the four group-by-period means up. Take the change over time within each group, then difference those changes:
![]()
The order does not matter — difference across groups first instead, and you land on the same number. The control group’s change is doing one job here: it estimates the trend the treated group would have followed on its own. Subtract it, and δ̂ is the treated group’s departure from that trend.
3 · The parallel-trends assumption
Everything rests on one condition. Absent the policy, the treated and control groups would have moved in parallel. The control’s change is a valid stand-in for the treated group’s missing counterfactual only if the two trends would have tracked each other.
This assumption is about a world you never observe, so you cannot test it directly — but you can threaten it. Anything that bends one group’s underlying path differently around the policy date — a regional shock, a group-specific trend, selection into treatment — breaks parallel trends and biases δ̂. Levels may differ freely; it is the slopes that must match.
4 · The regression formulation
The 2×2 table has a regression twin that scales to real data and delivers a standard error. Estimate:
![]()
Read the coefficients off the cells. β₀ is the control group before, β₁ the fixed treated-minus-control gap, β₂ the common before-to-after trend. The interaction coefficient δ is the difference-in-differences — identical to the double difference from the table. With more groups and periods this generalises, and δ can also be recovered as a two-way fixed-effects estimate. One caveat: observations within a group are correlated, so standard errors are usually clustered at the group level. (Regression discontinuity instead identifies its effect from a jump at a cutoff — a different design.)
5 · Diagnosing pre-trends
You cannot test parallel trends after the policy, but you can look before it. With several pre-periods, estimate the treated-minus-control gap in each, normalised to the last period before treatment. Under parallel trends these pre-treatment coefficients should sit near zero — the groups tracked each other before anything happened. A coefficient that drifts from zero before the policy is a warning: the groups were already diverging, and δ̂ will absorb that as if it were the effect. This lead-and-lag plot is the event study, and examiners treat clean pre-period zeros as what earns a DiD its credibility.
Worked example — a minimum-wage rise in one state
One state raises its minimum wage. A neighbouring state does not. You measure average employment per fast-food restaurant, before and after.
Step 1 — The four cell means. Treated state: 20 before, 21 after. Control state: 22 before, 26 after.
Step 2 — The first naive read. Treated before-to-after: 21 − 20 = +1. Alone, this says the higher minimum wage raised employment. But both states’ economies grew over the period.
Step 3 — The second naive read. Treated minus control, after only: 21 − 26 = −5. Alone, this says the policy cost five jobs per restaurant. But the treated state already sat 2 below the control before anything changed.
Step 4 — The double difference. Treated change (+1) minus control change (+4) = −3. Equivalently, the after-gap (−5) minus the before-gap (−2) = −3. Both routes agree.
Step 5 — The counterfactual. Apply the control’s +4 trend to the treated group’s start: 20 + 4 = 24 — where the treated state would have landed under parallel trends. It reached 21. The gap, 21 − 24 = −3, is δ̂: the policy lowered employment by three per restaurant.
Step 6 — A pre-trend that breaks it. Add one earlier period: treated 18, control 19. Between then and “before”, the treated state gained 2 while the control gained 3 — a placebo DiD of 2 − 3 = −1. The groups were not parallel beforehand; the treated state was already losing ground at 1 per period.
Step 7 — Resolve and interpret. If that −1 trend persisted, the treated group’s counterfactual change is +4 − 1 = +3, so the honest counterfactual is 20 + 3 = 23 and the true effect is 21 − 23 = −2. The raw −3 splits cleanly: −1 was pre-existing divergence, −2 was the policy — exactly what a pre-trend check flags. Check the leads before you trust the estimate.
Can you compute the double difference and defend the parallel-trends assumption behind it, pre-trend check included? That combination is where difference-in-differences marks are won and lost. Rehearsing it on your own problem sets is exactly what a one-on-one econometrics tutor does with you. Book a trial session.
Practice
Q1. A city introduces a soda tax; a comparable city does not. Sales per store (cases): taxed city 500 before, 440 after; control city 480 before, 460 after. Compute the difference-in-differences estimate, and both naive differences.
Q2. A fitted DiD regression gives β₀ = 12, β₁ = 3, β₂ = −2, δ = −4. State (a) the estimated treatment effect, (b) the treated group’s mean before, (c) the predicted control mean after, (d) the predicted treated mean after.
Q3. Before a reform, the treated group’s outcome rose by 6 and the control’s by 4. Over the reform window, the treated rose by 10 and the control by 5. Find (a) the naive DiD, (b) the pre-trend (placebo) DiD, (c) the effect corrected for a persisting pre-trend.
Answers. Q1: DiD = (440 − 500) − (460 − 480) = −60 − (−20) = −40; naive before-after = −60; naive after cross-section = 440 − 460 = −20. Q2: (a) δ = −4; (b) β₀ + β₁ = 15; (c) β₀ + β₂ = 10; (d) β₀ + β₁ + β₂ + δ = 9. Q3: (a) 10 − 5 = +5; (b) 6 − 4 = +2, so parallel trends fails; (c) +5 − 2 = +3.
Key takeaways
- Difference the differences. Subtract the control’s change from the treated group’s; the common trend and the fixed group gap both cancel, leaving the treated group’s departure from trend.
- Parallel trends is the whole assumption. Levels may differ; slopes may not. The control’s change must be the trend the treated group would have followed on its own.
- The interaction coefficient is the estimate. In Y = β₀ + β₁Treat + β₂Post + δ(Treat×Post), the term δ equals the 2×2 double difference and comes with a (clustered) standard error.
- Check the leads. Pre-treatment event-study coefficients should be near zero. A nonzero pre-trend means part of δ̂ is pre-existing divergence, not the policy.
Why Columbia students choose our econometrics tutoring
- PhD econometricians, not generalists: sessions are led by tutors who have estimated these models in their own research, so the identification talk is first-hand.
- Aligned to your problem sets: tutors work from your course notation and your dataset — a 2×2 table by hand or a fixed-effects panel in Stata or R.
- The identifying assumption, drilled: the marks in a DiD question sit on parallel trends and the pre-trend check, rehearsed until they come out cleanly under exam pressure.
FAQ
Q: Is difference-in-differences the same as just comparing before and after?
A: No. A before-after comparison on the treated group alone credits the policy with every other change over the period. DiD subtracts the control group’s change to strip out that common trend.
Q: What is the parallel-trends assumption in plain terms?
A: That without the policy, the two groups would have moved in step. Their levels can differ; their trends cannot. If it holds, the control’s change is a valid stand-in for the treated group’s missing counterfactual.
Q: Can you test parallel trends?
A: Not directly — it concerns a counterfactual you never observe. You test it indirectly with an event study: estimate the group gap in several pre-treatment periods. Coefficients near zero support the assumption; a pre-trend undermines it.
Q: Where does the effect show up in the regression?
A: In the interaction term. Regress the outcome on a treated dummy, a post dummy, and their product; the product’s coefficient δ is the difference-in-differences estimate.
Q: Why are the standard errors clustered?
A: Observations within a group and over time are correlated, so treating them as independent understates the uncertainty. Clustering at the group level corrects the standard errors and leaves the estimate δ̂ untouched.
Book an econometrics tutor for Columbia University, New York
Difference-in-differences rewards students who can compute the estimate and defend the assumption behind it. One-on-one sessions build both, on your course’s own problem sets. Tell us your module and exam date, and we’ll match you with the right tutor this week.