Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 042
Research workflow/5 steps

Staggered DiD done three ways (did · did2s · fixest)

01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 5 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 5
01
Data prep

Build the staggered panel

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

One row per (unit, period); never-treated units get cohort 0 / Inf.

Reads fromNot specified Feeds intoNot specified
Key code
# id · period · cohort (first treated) · y
head(panel)
Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

A long, staggered panel: unit id, period, the unit's first-treatment period (cohort), and an outcome.

Show data format & exampleHide example

Format — one row per (unit, period). cohort = first treated period (0 = never).

 id  period  cohort   y
  1     2004     2006   8.1
  1     2005     2006   8.4
  2     2004        0   7.9   # never treated
03
Read the evidence

Results & interpretation

3 figures Workflow discussion 0
01FigureCallaway–Sant'Anna event study (aggte, dynamic): effect by length of exposure with pre-trend checks.
02Figuredid2s vs TWFE vs Callaway–Sant'Anna — the estimators side by side.
03FigureSun–Abraham (fixest) tracking the true effect where naive TWFE drifts.

Figures reproduced from the package's official documentation — unofficial community showcase; all credit to the original authors.

Context & interpretation

Personal recipe — figures are from each package's public docs; this is my own composition, not affiliated with the package authors.

When treatment rolls out at different times, plain TWFE is biased. I run three modern estimators on the same panel and overlay their event studies — if they agree, I trust the dynamics.

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion