Skip to content

Commit c92c2dc

Browse files
igerberclaude
andcommitted
Address PR #443 R3 review (2 P2, docs accuracy)
wooldridge-2023-review.md: - Aggregation note: stop attributing "Eqs. 7.2-7.4" to the 2023 paper (the 2023 paper describes aggregation only conceptually in Section 3.1; the formal cohort-share equations are from W2025 per REGISTRY.md) - Implementation Notes: separate paper notation from shipped API. Users provide cohort/first_treat; W_it is constructed internally from cohort+ time via _build_interaction_matrix (wooldridge.py:165-189), not passed as a column - Standard errors: add shipped-API restriction note — n_bootstrap > 0 is OLS-only (wooldridge.py:432-437) and rejected with survey_design (wooldridge.py:441-444) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b527f78 commit c92c2dc

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

docs/methodology/papers/wooldridge-2023-review.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,18 @@ When all units are treated at the same time `g`, the model simplifies to:
9898

9999
*Standard errors (Section 3, p. C47):*
100100
- Delta method for individual `τ̂_{gr}` and aggregated ATTs (Wooldridge 2010, problem 12.17)
101-
- Panel bootstrap (resampling units) is also valid — allows for serial dependence and model misspecification
101+
- Panel bootstrap (resampling units) is also valid in the paper's framework — allows for serial dependence and model misspecification
102102
- Cluster-robust SEs at unit level for pooled estimation
103103
- For nonlinear models: standard sandwich `(X'WX)⁻¹ meat (X'WX)⁻¹` where `W = diag(μ_i(1-μ_i))` for logit or `W = diag(μ_i)` for Poisson
104+
- **Note (shipped API restriction):** in `WooldridgeDiD`, `n_bootstrap > 0` is currently OLS-only (rejected for logit/Poisson at `diff_diff/wooldridge.py:432-437`) and rejected when `survey_design` is set (`diff_diff/wooldridge.py:441-444`). Use analytical SEs for nonlinear or survey paths.
104105

105106
*Aggregation (Section 3.1, p. C50):*
106107
- **Simple (static):** weighted average of immediate effects `τ̃_{sg}` across cohorts `g = q,...,T`, weights = cohort proportions among all eventually treated
107108
- **Dynamic (event study):** weighted average of `τ̃_{g,g+h}` for horizon `h ≥ 0` across cohorts, weights = cohort proportions
108109
- **Calendar time:** weighted average across cohorts for each calendar period
109110
- **Group:** weighted average across periods for each cohort
110111
- SEs for all aggregations via delta method or panel bootstrap
111-
- **Note (current implementation deviation):** the shipped `WooldridgeDiD` aggregations use cell-level observation-count weights `n_{g,t}` (matching Stata `jwdid_estat`) rather than the paper's cohort-share weights from Eqs. 7.2-7.4. See `docs/methodology/REGISTRY.md` "Aggregations" under WooldridgeDiD and the corresponding line in `TODO.md` ("Tech Debt from Code Reviews") for the tracked deviation.
112+
- **Note (current implementation deviation):** the shipped `WooldridgeDiD` aggregations use cell-level observation-count weights `n_{g,t}` (matching Stata `jwdid_estat`) rather than the cohort-share weights described conceptually in Section 3.1. The 2023 paper does not provide explicit aggregation-weight equations; the formal cohort-share equations referenced in `docs/methodology/REGISTRY.md` ("W2025 Eqs. 7.2-7.4") are from a later Wooldridge ETWFE source. See `docs/methodology/REGISTRY.md` "Aggregations" under WooldridgeDiD and the corresponding line in `TODO.md` ("Tech Debt from Code Reviews") for the tracked deviation.
112113

113114
*Testing parallel trends (Section 4):*
114115

@@ -174,11 +175,17 @@ Two approaches:
174175
## Implementation Notes
175176

176177
### Data Structure Requirements
177-
- Balanced or unbalanced panel: N units observed over T fixed time periods
178-
- Required: outcome `Y_{it}`, unit ID, time period, cohort indicator `D_g` (or `first_treat`), time-varying treatment `W_{it}`
179-
- Optional covariates (paper notation `X_i` is time-constant; shipped `diff_diff/wooldridge.py:394-411` supports a richer set): `exovar` (time-invariant, no interaction or demeaning), `xtvar` (time-varying, demeaned within cohort×period cells when `demean_covariates=True`), `xgvar` (covariates interacted with each cohort indicator). See `docs/methodology/REGISTRY.md` under WooldridgeDiD "Covariates".
180-
- `W_{it}` is absorbing: once treated, always treated (no exit unless using Section 7.2 extension)
181-
- Cohorts defined by first treatment period `g ∈ {q, q+1, ..., T, ∞}`
178+
179+
*Paper notation:* `Y_{it}` (outcome), `D_g` (cohort indicator), `W_{it}` (time-varying treatment), `X_i` (time-invariant covariates).
180+
181+
*Shipped API (`diff_diff/wooldridge.py:394-411`):* users provide outcome, unit ID, time, and `cohort` (or `first_treat`). The model derives `W_{it}` internally from `cohort` and `time` via `_build_interaction_matrix` (`diff_diff/wooldridge.py:165-189`) — users do NOT pass `W_{it}` as a column.
182+
183+
*Covariates (richer than paper notation):* `exovar` (time-invariant, no interaction or demeaning), `xtvar` (time-varying, demeaned within cohort×period cells when `demean_covariates=True`), `xgvar` (covariates interacted with each cohort indicator). See `docs/methodology/REGISTRY.md` under WooldridgeDiD "Covariates".
184+
185+
*Other contracts:*
186+
- Balanced or unbalanced panel: N units observed over T fixed time periods.
187+
- Treatment is absorbing: once treated, always treated (no exit unless using Section 7.2 extension).
188+
- Cohorts defined by first treatment period `g ∈ {q, q+1, ..., T, ∞}`.
182189

183190
### Computational Considerations
184191
- Pooled estimation is a single regression over all N×T observations — O(N·T·K²) where K is number of parameters

0 commit comments

Comments
 (0)