Skip to content

Commit 968fe76

Browse files
committed
Refactor Sun-Abraham to use true saturated regression approach
This addresses code review feedback by implementing the methodology from Sun & Abraham (2021) using a saturated TWFE regression instead of 2x2 DiD comparisons. Key changes: - Implement _fit_saturated_regression() with cohort × relative-time interaction dummies and two-way within transformation - Add proper covariate support through the regression framework - Use cluster-robust standard errors from regression output - Compute IW effects using delta method with full vcov matrix - Switch to pairs bootstrap (removed unused bootstrap_weights param) - Fix linting issues (unused imports, dead code, bare exceptions) - Optimize DataFrame operations to avoid fragmentation warnings - Update tests to reflect API changes (29 tests pass) The new implementation matches the academic literature exactly: 1. Saturated TWFE: Y_it = α_i + λ_t + Σ_g Σ_e δ_{g,e} D_{g,e,it} + X'γ + ε 2. Cohort weights: w_{g,e} = n_g / Σ_g' n_g' 3. IW aggregation: β_e = Σ_g w_{g,e} × δ_{g,e}
1 parent 4d13dcd commit 968fe76

2 files changed

Lines changed: 400 additions & 334 deletions

File tree

0 commit comments

Comments
 (0)