Tutorials#

Every tutorial is a runnable Jupyter notebook. If you are new to diff-diff, start with Basic DiD; if you are measuring a business intervention, start with the Business Applications track.

Business Applications#

Practitioner walkthroughs built around marketing and policy scenarios.

Brand Awareness Surveys

Measure campaign impact on brand awareness with complex survey data and staggered rollouts.

Measuring Campaign Impact on Brand Awareness with Survey Data
Geo-Experiments

Measure lift from a campaign that ran in a subset of geographic markets using Synthetic DiD.

Geo-Experiment Analysis with SyntheticDiD
dCDH Marketing Pulse

Analyze on/off pulse campaigns with the de Chaisemartin-D’Haultfoeuille estimator for reversible treatments.

dCDH for Marketing Pulse Campaigns
HAD Brand Campaign

Estimate per-dollar lift when every market receives a different spend intensity.

HAD for a National Brand Campaign with Regional Spend Intensity
HAD Pre-test Workflow

Run the pre-test diagnostics on the brand-campaign panel before trusting the estimate.

HAD Pre-test Workflow - Running the Pre-test Diagnostics on the Brand Campaign Panel
Survey-Weighted HAD

Heterogeneous-adoption DiD on a BRFSS-shape survey rollout with design weights.

Survey-Weighted HAD - The BRFSS-Shape Rollout
Spillover DiD (TVA)

Handle treatment that spills over onto nearby control units in a TVA-style worked example.

Spillover-aware DiD with SpilloverDiD — a TVA-style worked example
Composition Drift & Calibration

Survey calibration for causal DiD when who answers changes over time.

When Who Answers Changes: Survey Calibration for Causal DiD
Distributional Effects (CiC)

See which quantiles moved when the average hides the action, with Changes-in-Changes.

When the Average Hides the Action - Distributional DiD with Changes-in-Changes

Fundamentals#

The core DiD toolkit, from your first 2x2 design to real published datasets.

Basic DiD

Your first 2x2 DiD: column-name and formula interfaces, covariates, fixed effects, and robust inference.

Basic Difference-in-Differences with diff-diff
Staggered DiD

Handle staggered treatment adoption with modern heterogeneity-robust estimators.

Staggered Difference-in-Differences
Synthetic DiD

Combine DiD with synthetic-control weighting (Arkhangelsky et al. 2021).

Synthetic Difference-in-Differences (SDID)
Triple Difference (DDD)

Add a second comparison dimension when treatment requires satisfying two criteria.

Triple Difference (DDD) Estimation
Real-World Examples

Classic datasets end to end: Card & Krueger minimum wage, Castle Doctrine, and more.

Real-World Data Examples

Advanced Methods#

Modern estimators for designs the basic toolkit cannot handle.

TROP

Triply robust panel estimator with factor-model adjustment (Athey et al. 2025).

Triply Robust Panel (TROP) Estimator
Imputation DiD

The efficient imputation estimator of Borusyak, Jaravel & Spiess (2024).

Imputation DiD (Borusyak, Jaravel & Spiess 2024)
Two-Stage DiD

Gardner (2022) two-stage residualized estimation for staggered designs.

Two-Stage DiD (Gardner 2022)
Stacked DiD

Stacked event studies with corrective weights (Wing, Freedman & Hollingsworth 2024).

Stacked DiD (Wing, Freedman & Hollingsworth 2024)
Continuous DiD

Dose-response treatment effects with continuous treatment intensity.

Continuous Difference-in-Differences
Efficient DiD

Semiparametrically efficient ATT estimation (Chen, Sant’Anna & Xie 2025).

Efficient DiD (Chen, Sant’Anna & Xie 2025)
Survey-Aware DiD

DiD on stratified survey microdata with design-based inference.

Survey-Aware Difference-in-Differences
Wooldridge ETWFE

Wooldridge’s extended two-way fixed effects via pooled OLS.

Wooldridge Extended Two-Way Fixed Effects (ETWFE)
Synthetic Control for Policy

Single-treated-unit policy evaluation with two routes to inference.

Synthetic control for a policy evaluation: two routes to inference

Study Design#

Assess identifying assumptions and size your study before committing to it.

Parallel Trends Diagnostics

Assess pre-treatment evidence relevant to parallel trends, check test power, and run the full diagnostic suite.

Testing Parallel Trends and DiD Diagnostics
Honest DiD Sensitivity

Robust inference under parallel-trends violations (Rambachan & Roth 2023).

Honest DiD: Sensitivity Analysis for Parallel Trends
Power Analysis

Compute minimum detectable effects and sample sizes before running the study.

Power Analysis for Difference-in-Differences
Pre-Trends Power

Check whether your pre-trends test can actually detect violations (Roth 2022).

Pre-Trends Power Analysis (Roth 2022)
Staggered vs Collapsed Power

Staggered rollout or a simple 2x2? A power-analysis decision guide.

Staggered Rollout or a Simple 2×2? A Power-Analysis Decision Guide