Difference-in-Differences
In March, Pantry launched 20-minute express delivery in Pune but not in Nashik. By April, Pune's orders were up sharply, and the launch team wants credit for all of it. But March also brought Holi and the start of wedding season, and orders rose in Nashik too, where nothing launched. How much of Pune's rise did express delivery actually cause?
The rule
Subtract the comparison group's change to remove the shared trend.
Neither simple comparison works on its own:
- Pune before versus after mixes the launch with everything else that changed over those months: season, marketing, prices.
- Pune versus Nashik after the launch mixes the launch with the gaps that already existed between the two cities.
Difference-in-differences (DiD) subtracts both problems away. First take each city's change over time, then take the difference between those changes:
Weekly orders per 1,000 customers:
| City | February | April | Change |
|---|---|---|---|
| Pune, with express | 40 | 52 | +12 |
| Nashik, without | 30 | 36 | +6 |
Nashik's +6 shows what happened anyway. Pune's extra rise beyond that, 12 − 6 = +6 orders per 1,000 customers a week, is the estimated effect of express delivery.
The whole method rests on one assumption, parallel trends: without the launch, Pune would have changed by the same amount as Nashik. The levels may differ (40 against 30); the trends must match. You cannot see the Pune that never got express, but you can check the months before the launch. If both cities rose in step from October to February, the assumption is believable. If Pune was already pulling away, the estimate will credit that head start to express delivery.