Glossary · Statistics
Difference-in-Differences
Also called: DiD · diff-in-diff
Estimating a causal effect by comparing the change over time in a treated group with the change over the same period in an untreated group.
Definition
Difference-in-differences subtracts the before-and-after change in a comparison group from the before-and-after change in the group that received a treatment, such as a new policy or program. The first difference removes stable differences between groups, and the second removes trends that affect both groups alike. The key assumption is parallel trends: without the treatment, both groups would have moved together, which can be checked partly by comparing their paths before the change. It is widely used when randomized experiments are impractical, for example with store-level or regional rollouts.
Formula
TeX source
\hat\delta = \big(\bar{Y}_{T,\text{after}} - \bar{Y}_{T,\text{before}}\big) - \big(\bar{Y}_{C,\text{after}} - \bar{Y}_{C,\text{before}}\big)Worked example
Try it in a tool
Related terms
- Incrementality: The part of an outcome that would not have happened without a marketing action, measured against a comparable group that was not exposed.
- A/B Testing: A controlled experiment that randomly splits users between two versions of a page, message or offer to measure which performs better on a chosen metric.
- Omitted Variable Bias: Distortion in a regression coefficient caused by leaving out a variable that affects the outcome and is correlated with an included predictor.
- Selection Bias: Distortion that arises when the observations analyzed are not representative of the population of interest because of how they were chosen or retained.
- Linear Regression: A statistical method that models an outcome as a linear combination of predictors, choosing coefficients that minimize the sum of squared errors.