Skip to content

Commit f84173d

Browse files
authored
Merge pull request #88 from igerber/refactor/split-staggered-module
Refactor staggered.py into multiple modules using mixins
2 parents 8c1471a + c383bf7 commit f84173d

5 files changed

Lines changed: 1415 additions & 1293 deletions

File tree

CLAUDE.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,27 @@ pytest tests/test_rust_backend.py -v
6868
- **`diff_diff/synthetic_did.py`** - Synthetic DiD estimator:
6969
- `SyntheticDiD` - Synthetic control combined with DiD (Arkhangelsky et al. 2021)
7070

71-
- **`diff_diff/staggered.py`** - Staggered adoption DiD estimators:
71+
- **`diff_diff/staggered.py`** - Staggered adoption DiD main module:
7272
- `CallawaySantAnna` - Callaway & Sant'Anna (2021) estimator for heterogeneous treatment timing
73-
- `CallawaySantAnnaResults` - Results with group-time ATT(g,t) and aggregations
74-
- `CSBootstrapResults` - Bootstrap inference results (SEs, CIs, p-values for all aggregations)
73+
- Core estimation methods: `_precompute_structures()`, `_compute_att_gt_fast()`, `fit()`
74+
- Estimation approaches: `_outcome_regression()`, `_ipw_estimation()`, `_doubly_robust()`
75+
- Re-exports result and bootstrap classes for backward compatibility
76+
77+
- **`diff_diff/staggered_results.py`** - Result container classes:
7578
- `GroupTimeEffect` - Container for individual group-time effects
79+
- `CallawaySantAnnaResults` - Results with group-time ATT(g,t), `summary()`, `to_dataframe()`
80+
81+
- **`diff_diff/staggered_bootstrap.py`** - Bootstrap inference:
82+
- `CSBootstrapResults` - Bootstrap inference results (SEs, CIs, p-values for all aggregations)
83+
- `CallawaySantAnnaBootstrapMixin` - Mixin with bootstrap methods
84+
- `_generate_bootstrap_weights_batch()` - Vectorized weight generation
7685
- Multiplier bootstrap with Rademacher, Mammen, or Webb weights
7786

87+
- **`diff_diff/staggered_aggregation.py`** - Aggregation methods:
88+
- `CallawaySantAnnaAggregationMixin` - Mixin with aggregation methods
89+
- `_aggregate_simple()`, `_aggregate_event_study()`, `_aggregate_by_group()`
90+
- `_compute_aggregated_se_with_wif()` - SE with weight influence function adjustment
91+
7892
- **`diff_diff/sun_abraham.py`** - Sun-Abraham interaction-weighted estimator:
7993
- `SunAbraham` - Sun & Abraham (2021) estimator using saturated regression
8094
- `SunAbrahamResults` - Results with event study effects and cohort weights

0 commit comments

Comments
 (0)