σ StatsDoge Causal inference workflows
6
σ Building block · used in 1 workflow

Two-stage difference-in-differences

ATT DiDEvent Study
Source did2s — Butts & Gardner
Summary by StatsDoge

Gardner's two-stage estimator: remove unit/time fixed effects from untreated obs, then regress residuals on treatment — robust to heterogeneous timing.

You're looking at a building block — one of the estimators a workflow uses inside its pipeline. You reached it from a workflow step; it's used in 1 workflow (listed below).
https://github.com/kylebutts/did2s unpinned — link may rot

⚠️ Unofficial community write-up of did2s. This account is not affiliated with the authors; it summarizes the public documentation for demonstration. All credit & copyright belong to the original authors.

What it does

Estimates event-study / ATT under staggered adoption in two stages: (1) fit unit + time fixed effects on the untreated observations only; (2) regress the residualized outcome on the treatment indicators. This sidesteps the TWFE negative-weighting problem.

library(did2s)
est <- did2s(data, yname = "y", first_stage = ~ 0 | id + year,
             second_stage = ~ i(rel_year), treatment = "treat", cluster_var = "id")

Used in these workflows (1)

Discussion (0)

  • No comments yet — start the conversation.