Source
did2s — Butts & Gardner
@misc{did2s,
title = {did2s},
author = {Butts and Gardner},
howpublished = {\url{https://kylebutts.github.io/did2s/}},
note = {Software / documentation}
}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)
-
Two-stage difference-in-differences (did2s)
Gardner's 2-stage estimator for staggered DiD: residualize on the untreated, then estimate the event study — fast and timing-robust.
Discussion (0)
Log in to join the discussion.