You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
callaway_santanna(panel=False): repeated cross-sections support
Close the last significant capability gap vs `csdid` / `differences`:
repeated-cross-sections (RCS) data where observations are not matched
across time.
Under `panel=False`, each (g, t) ATT is estimated as the unconditional
2×2 cell-mean DID
ATT(g, t) = (Ȳ_{g, t} - Ȳ_{g, base}) - (Ȳ_{c, t} - Ȳ_{c, base})
with c = never-treated cohort, and observation-level influence
functions
ψ_i = 1{G_i=g, T_i=t} (Y_i - Ȳ_{g, t}) / p_{g, t}
- 1{G_i=g, T_i=base} (Y_i - Ȳ_{g, base}) / p_{g, base}
- 1{G_i=c, T_i=t} (Y_i - Ȳ_{c, t}) / p_{c, t}
+ 1{G_i=c, T_i=base} (Y_i - Ȳ_{c, base}) / p_{c, base}
stacked into the inf_matrix slot that aggte() / cs_report() / ggdid()
/ honest_did() already consume — so the RCS path gets the full
pipeline (Mammen multiplier bootstrap uniform bands, all four
aggregations, R-R breakdown M*) *for free* with no changes to the
downstream modules.
Scope of this commit (documented as NotImplementedError on other paths):
- only estimator='reg' (unconditional 2×2 DID; IPW/DR for RCS later)
- only control_group='nevertreated'
- no covariates (future: OLS residualisation per cell)
Tests (tests/test_cs_rcs.py, 11 cases):
* RCS path returns CausalResult with `panel=False` flag set
* overall ATT > 0 with p < 0.01 on a 1200-obs RCS DGP
* detail grid has the expected (g, t) rows
* influence functions are obs-level (n_obs × K)
* aggte(type='dynamic') runs and delivers uniform bands
* cs_report composes on an RCS CausalResult
* honest_did consumes the RCS event study
* informative NotImplementedError on {covariates, IPW/DR, notyettreated}
* RCS and panel modes agree point-by-point on a balanced panel
Full DiD suite: 142/142 (was 131).
References:
Callaway, B. and Sant'Anna, P.H.C. (2021). "Difference-in-Differences
with Multiple Time Periods." J. of Econometrics 225(2), 200-230.
Section 2 / eqn (2.4) — RCS version of the 2×2 DID.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments