Difference-in-Differences

College Depth 86 in the knowledge graph I know this Set as goal
Unlocks 17 downstream topics
DiD difference-in-differences parallel-trends policy-evaluation

Core Idea

Difference-in-differences (DiD) estimates causal treatment effects by comparing the pre-to-post change in the treatment group to the pre-to-post change in a comparison group. The estimator is β̂_DiD = (Ȳ_treated,post − Ȳ_treated,pre) − (Ȳ_control,post − Ȳ_control,pre), which differences out both pre-existing differences and aggregate time trends. The critical identifying assumption is parallel trends: in the absence of treatment, the treatment and control groups would have followed the same trajectory. This assumption is untestable at the exact period of treatment but is supported by showing parallel pre-trends in the data.

How It's Best Learned

Replicate Card and Krueger's (1994) minimum wage study using New Jersey and Pennsylvania as treatment and control — this is the canonical DiD application in labor economics.

Common Misconceptions

Explainer

You already know from the potential outcomes framework that the fundamental problem of causal inference is that we can never observe the same unit in both the treated and untreated states at the same time. The naive fix — compare treated units to untreated units after treatment — fails because the groups may differ for reasons unrelated to treatment. Difference-in-differences solves this by using time to construct the missing counterfactual. Instead of asking "what would the treated group have looked like untreated?", DiD asks "how did the treated group's trajectory differ from the control group's trajectory during the same period?"

The estimator is literally two differences stacked. First, you difference within each group: compute the before-to-after change for the treatment group and the before-to-after change for the control group. Then you difference the two differences. This double-differencing cancels out anything that was stable over time within each group (fixed differences in levels) and anything that affected both groups equally across time (common time trends). What remains is the portion of the treated group's change that cannot be explained by the time trend alone — the treatment effect.

The identifying assumption — parallel trends — is the load-bearing pillar of every DiD study. It says that in the absence of treatment, the treatment and control groups would have moved in parallel over time. This is explicitly a claim about a counterfactual you cannot observe. What you can do is check pre-treatment periods: if the two groups were trending in parallel before treatment, it is more plausible they would have continued to do so. The canonical example, Card and Krueger (1994), compared fast-food employment in New Jersey (raised minimum wage) and Pennsylvania (did not) before and after the policy change. The DiD estimate found no negative employment effect — a landmark result precisely because the research design was credible.

In practice, DiD is implemented as a regression. You create a treatment dummy (1 = treatment group), a post dummy (1 = after treatment), and their interaction. The coefficient on the interaction term is the DiD estimate. This connects directly to your dummy variable knowledge: the interaction isolates the group-period cell where treatment occurred. Adding additional covariates and unit fixed effects (which you know from fixed effects models) further controls for confounders and absorbs unit-level heterogeneity, strengthening the design. The key caution from the misconceptions is worth internalizing: parallel trends is a claim about counterfactual *trends*, not about levels — the groups can be very different in absolute terms before treatment begins.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionProbability Density Functions and Continuous DistributionsCumulative Distribution FunctionsContinuous Random VariablesNormal DistributionCentral Limit TheoremConfidence Intervals for MeansZ-Tests and T-Tests for MeansOne-Sample Z-Test for MeansOne-Sample and Two-Sample T-TestsOne-Way ANOVAF-Test and Joint SignificanceR-Squared and Model FitMulticollinearityRobust Standard ErrorsPanel Data: Structure and AdvantagesFixed Effects ModelsDifference-in-Differences

Longest path: 87 steps · 432 total prerequisite topics

Prerequisites (5)

Leads To (4)