Skip to contentScholarGate
LibraryBookshelfDeskReview StudioAssistant
Sign in
On this page
IntuitionHow it worksWhen to use itStrengths & limitationsCommon pitfallsApplicationsFrequently asked🔒 Read the full methodSourcesRelated methods
Cite this pageSpotted an issue on this page? Report or suggest a fix →
Home›Causal inference›Panel Data Difference-in-Differences (Panel DiD / TWFE)
Regression modelQuasi-experimental / causal inference

Panel Data Difference-in-Differences (Panel DiD / TWFE)

Panel Data Difference-in-Differences Estimator · Also known as: Two-Way Fixed Effects DiD, TWFE, Panel DiD, Panel Diff-in-Diff

Panel Data Difference-in-Differences extends the classic two-period DiD design to settings with multiple units observed across many time periods. By absorbing unit-level fixed effects and time fixed effects simultaneously, it isolates the causal effect of a treatment or policy change while controlling for both time-invariant unit heterogeneity and common time shocks affecting all units.

ScholarGate
  1. Regression model
  2. v1
  3. 2 Sources
  4. PUBLISHED
Cite this page →
Tools & resources
Download slides
Learn & explore

Read the full method

Members only

Sign in with a free account to read this section.

Sign in

Method map

The neighbourhood of related methods — select a node to explore.

Panel Data Difference-in-Differences
Difference-in-DifferencesPanel Fixed EffectsPropensity Score MatchingSynthetic Control MethodDynamic Difference-in-Di…Heterogeneous Treatment…Multi-period Difference-…Panel Data Causal Impact…Panel Data Entropy Balan…Panel Data Interrupted T…

+9 more

When to use it

Use Panel DiD when you have a balanced or unbalanced panel of units observed over multiple time periods, a treatment that switches on for some units (staggered or simultaneous) while others serve as controls, and an outcome measured repeatedly for each unit. It is well-suited to policy evaluation, labour economics, and health research where administrative panel data are available. It is not appropriate when you have only a single pre- or post-period (use basic DiD instead), when all units are treated at the same time (no within-period variation), when fewer than roughly 40 units are clustered, or when treatment adoption is driven by outcome trends (violating parallel trends). Be cautious with staggered adoption: in heterogeneous-effects settings the TWFE estimate can be a misleading weighted average; consider modern staggered DiD estimators in that case.

Strengths & limitations

Strengths
  • Controls simultaneously for unit-level time-invariant confounders and period-level common shocks via two-way fixed effects.
  • Exploits rich panel variation, yielding more precise estimates than two-period designs when many units and periods are available.
  • Transparent and interpretable: the treatment effect is a single regression coefficient with a clear counterfactual logic.
  • Widely accepted in economics and social sciences; journals expect the TWFE specification as a standard causal-inference tool.
  • Can accommodate time-varying covariates alongside fixed effects to further reduce residual confounding.
Limitations
  • The parallel-trends assumption is strong and untestable for the post-treatment period; any divergence in trends biases the estimate.
  • Standard TWFE can produce misleading estimates under staggered treatment adoption with heterogeneous treatment effects, because late adopters can serve as controls for early adopters with negative implicit weights.
  • Requires repeated observations of the same units, which is not always available; cross-sectional data cannot support this design.
  • Clustering standard errors at the unit level requires enough clusters (typically 30+); too few clusters make inference unreliable even with large N×T.
  • Does not handle violations of the stable unit treatment value assumption (SUTVA): spillovers between treated and control units will contaminate the estimate.

Frequently asked

How does Panel DiD differ from basic two-period DiD?

Basic DiD uses one pre- and one post-period for two groups and relies on a single interaction term. Panel DiD generalises this to many units and many periods, replacing the group and time dummies with full unit and time fixed effects. This absorbs richer heterogeneity and allows testing of parallel pre-trends, but also requires checking for problems specific to multi-period settings, such as serial correlation and staggered-adoption bias.

What is two-way fixed effects (TWFE)?

TWFE is the regression specification underlying Panel DiD. It includes a full set of unit fixed effects (one per panel unit) and a full set of time fixed effects (one per period), together with the treatment indicator. The unit fixed effects remove permanent between-unit differences; the time fixed effects remove period-level shocks common to all units. The treatment coefficient is then identified from within-unit variation over time, net of any common trend.

Why do I need to cluster standard errors?

Bertrand, Duflo, and Mullainathan (2004) showed that outcomes for the same unit across years are serially correlated. If standard errors are computed assuming independence across observations, they can be three to eight times too small, producing t-statistics far above conventional thresholds even under the null. Clustering at the unit (or treatment-assignment) level corrects for this by allowing arbitrary within-cluster correlation.

Is Panel DiD valid with staggered treatment timing?

The standard TWFE estimator is valid only if treatment effects are homogeneous across cohorts and time. When effects are heterogeneous — which is common — the TWFE coefficient is a weighted average of cohort-specific ATTs where some weights can be negative, potentially reversing the sign of the estimate. Modern staggered DiD estimators (Callaway & Sant'Anna, Sun & Abraham, Borusyak et al.) avoid these negative weights and should be preferred in heterogeneous settings.

How do I test the parallel-trends assumption?

The standard diagnostic is an event-study plot: include leads (lags of future treatment) and lags (periods after treatment) in the regression and plot their coefficients. If pre-treatment coefficients (leads) are jointly close to zero and statistically insignificant, the parallel-trends assumption is supported for the pre-period. Note this is a necessary but not sufficient condition — parallel pre-trends do not guarantee parallel counterfactual trends after treatment.

Sources

  1. Angrist, J. D., & Pischke, J.-S. (2009). Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press. ISBN: 978-0691120355
  2. Bertrand, M., Duflo, E., & Mullainathan, S. (2004). How Much Should We Trust Differences-in-Differences Estimates? Quarterly Journal of Economics, 119(1), 249-275. DOI: 10.1162/003355304772839588 ↗

How to cite this page

ScholarGate. (2026, June 3). Panel Data Difference-in-Differences Estimator. ScholarGate. https://scholargate.app/en/causal-inference/panel-data-difference-in-differences

Related methods

Difference-in-DifferencesPanel Fixed EffectsPropensity Score MatchingSynthetic Control Method

Which method?

Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.

  • Difference-in-DifferencesEconometrics↔ compare
  • Panel Fixed EffectsEconometrics↔ compare
  • Propensity Score MatchingResearch Statistics↔ compare
  • Synthetic Control MethodCausal inference↔ compare
Compare side by side →

Referenced by

Dynamic Difference-in-DifferencesHeterogeneous Treatment Effect Difference-in-DifferencesMulti-period Difference-in-differencesPanel Data Causal Impact AnalysisPanel Data Entropy BalancingPanel Data Interrupted Time SeriesPanel Data Marginal Structural ModelPanel Data Matching EstimatorPanel Data Placebo TestPanel Data Propensity Score MatchingPanel Data Propensity Score WeightingPanel Data Regression Discontinuity DesignPanel Data Synthetic Control MethodPanel Event Study in Education ResearchRobust Difference-in-Differences

Similar methods

Staggered Difference-in-DifferencesDifference-in-DifferencesPanel Event StudyDynamic Difference-in-DifferencesPanel Data Matching EstimatorPolicy Evaluation Difference-in-DifferencesPanel Data Propensity Score MatchingMulti-period Difference-in-differences

Related reference concepts

Quasi-Experimental and Natural Experiment DesignNatural ExperimentMultiple or Simultaneous Equation Models • Multiple VariablesEconometricsMultilevel and Partial Pooling ModelsStudy Matching and Stratification

Spotted an issue on this page? Report or suggest a fix →

ScholarGate — Panel Data Difference-in-Differences (Panel Data Difference-in-Differences Estimator). Retrieved 2026-07-21 from https://scholargate.app/en/causal-inference/panel-data-difference-in-differences · Dataset: https://doi.org/10.5281/zenodo.20539026
Quick facts
Originator
Ashenfelter & Card (1985); codified by Angrist & Pischke (2009); serial correlation critique by Bertrand, Duflo & Mullainathan (2004)
Year
1985–2004
Type
Causal inference / panel regression
DataType
Panel data (multiple units, multiple time periods)
Subfamily
Quasi-experimental / causal inference
Related methods
Difference-in-DifferencesPanel Fixed EffectsPropensity Score MatchingSynthetic Control Method
ScholarGate

A content-first reference library for research methods — what each one is, how it works, and where it comes from.

Open data (CC-BY)

Explore

  • Library
  • Search the library…
  • Browse by field
  • Fields
  • Journey
  • Compare
  • Which method?

Reference

  • Subjects
  • Atlas
  • Glossary
  • Methodology
  • Philosophy

Your tools

  • Bookshelf
  • Desk
  • Chat

Company

  • About
  • Pricing
  • Contact
  • Suggest a method

Entries are compiled from published sources for reference. Verifying the accuracy and suitability of any information for your own use remains your responsibility.

© 2026 ScholarGate · A research-method reference library
  • Privacy
  • Cookies
  • Terms
  • Delete account