PR-B: WooldridgeDiD tracker promotion + methodology bundle#486
Conversation
|
Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
Closes the WooldridgeDiD (ETWFE) methodology-review-tracker promotion in METHODOLOGY_REVIEW.md (In Progress → Complete), following the primary-source review for Wooldridge (2025) merged in PR-A (#484). Adds two paper-driven implementation surfaces and extends R-parity goldens to the nonlinear paths. Implementation: - `aggregate(weights="cohort_share")` on WooldridgeDiDResults implements paper Eqs. 7.4 (simple-overall) and 7.6 (event-time, restricted to k>=0) cohort-share aggregation weights as an opt-in alternative to the default cell-count weighting (matching Stata `jwdid_estat`). Inference fields fail-closed to NaN with UserWarning per paper Section 7.5 conditional-on-shares semantics; raises on `survey_design` (design-consistent totals deferred); raises on `type ∈ {"group","calendar"}` (no paper closed-form); raises on bootstrap fits (no matching bootstrap variant). Closes TODO row 95. - `cohort_trends=True` on `WooldridgeDiD.__init__` adds linear `dg_i · t` cohort-specific trend interactions (paper Section 8 / Eq. 8.1) for the OLS path. Rejects on logit/poisson per paper Section 8 OLS scope; rejects on survey_design pending full-dummy/TSL validation; enforces per-cohort pre-period identification check (≥ 2 observed pre-periods per treated cohort). Auto-routes to full-dummy mode regardless of vcov_type. Closes the PR-A Requirements Checklist heterogeneous-trends gap. Tests: - `tests/test_methodology_wooldridge.py` extended with 6 paper-equation-numbered methodology classes (Theorem 3.1, Proposition 5.1, Section 6 event study, Section 7 aggregation paths, Section 8 heterogeneous trends, Section 10 unbalanced panels) + `TestW2025LibraryDeviations` consolidating 5 surviving deviations. Mirrors the HAD PR #473 precedent. - Two new R-parity surface classes (`TestWooldridgeParityRPoisson`, `TestWooldridgeParityRLogit`) lock the structural surface against R `etwfe(family=...)` log-link goldens. - 209 tests total (60 methodology + 149 R-parity + unit regressions). R Goldens: - `benchmarks/R/generate_wooldridge_golden.R` extended with Poisson + logit DGPs via R `etwfe`; augmented panel CSV retains the same seed-generated `y_pois` + `y_logit` columns for cross-language reproducibility. - `benchmarks/R/requirements.R` pins `etwfe >= 0.5.0`. Tracker promotion: - METHODOLOGY_REVIEW.md L52 status flip with merge date; detail section L583-605 rewritten to the Verified Components / Test Coverage / Corrections Made / Deviations / Outstanding Concerns template mirroring HAD / ContinuousDiD / DCDH. L27 example re-pointed; priority queue items #7-#10 renumbered to #6-#9. - REGISTRY.md `## WooldridgeDiD (ETWFE)` extended with `### Deviations from the paper / from R / library extensions` block consolidating 7 surviving deviations + opt-in notes for cohort_share + cohort_trends + survey rejection + bootstrap cohort_share rejection contracts. - CHANGELOG.md `[Unreleased]` `### Added` documents the new parameters, R-parity extension, and tracker flip. - `docs/methodology/papers/wooldridge-2025-review.md` Requirements Checklist + Gaps & Uncertainties items 1 + 11 marked `**Status:** Closed in PR-B`. - `docs/api/wooldridge_etwfe.rst` updated with weighting-scheme notes alongside the existing aggregation table. Second of two PRs for the WooldridgeDiD methodology-review-tracker promotion. PR-A merged at e416aed (#484). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rt_trends × group/calendar coverage + TODO row
9939fa1 to
379e065
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
Static re-review only. I did not run the test suite in this environment because the Python runtime here is missing project dependencies ( |
…hort_share→cell regression
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…coefs baseline-normalization docstring
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
…Results metadata for cohort_trends/aggregation weights
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality No separate findings. Performance No findings. Maintainability No separate findings beyond the methodology/reporting contract issue above. Tech Debt No unmitigated findings. The remaining unsupported surfaces are properly tracked in Security No findings. Documentation/Tests
Path to Approval
|
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology No unmitigated findings. The methodology-sensitive changes are either aligned with the paper/registry or explicitly fail-closed and documented. Code Quality No findings. Performance No findings. The heavier full-dummy Maintainability
Tech Debt
Security No findings. Documentation/Tests
|
… in to_dataframe + repr + docstrings
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
…'never_treated' (unidentified)
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…treated rejection + remove stale TODO row reference
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
… shipped opt-in surface + test-count genericization
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Summary
aggregate(weights="cohort_share")(paper Eqs. 7.4 / 7.6; event path restricted to k≥0);cohort_trends=True(paper Section 8 / Eq. 8.1; OLS path; auto-routes to full-dummy; per-cohort pre-period identification check)benchmarks/R/generate_wooldridge_golden.Rwithetwfe(family="poisson")+etwfe(family="logit")log-link goldens;etwfepinned inbenchmarks/R/requirements.RTestW2025LibraryDeviations+ 2 surface R-parity classes for the nonlinear paths (209 tests total in the file, including the existing 12 vcov_type R-parity tests from PR wooldridge: thread vcov_type through OLS path (Phase 1b 3/8) #483)### Deviationsblock + CHANGELOG[Unreleased] ### Added+ TODO row 95 closed + paper-review Status inline notes + API doc updatesMethodology references
docs/methodology/REGISTRY.md## WooldridgeDiD (ETWFE)→### Deviations from the paper / from R / library extensionsfor the consolidated list (HC1 finite-sample factor, QMLE sandwich, nonlinear-vs-fixest, logit cohort+time dummies, anticipation + aggregation, cell-count default + opt-in cohort-share, conditional-on-shares inference, response-scale vs log-link nonlinear parity)Validation
tests/test_methodology_wooldridge.py(60 methodology tests; existing 12 vcov_type tests unchanged from PR wooldridge: thread vcov_type through OLS path (Phase 1b 3/8) #483)benchmarks/R/generate_wooldridge_golden.Rextended (Poisson + logit) +benchmarks/data/wooldridge_golden.jsonregenerated +benchmarks/data/wooldridge_test_panel.csvaugmented withy_pois+y_logitcolumnsSecurity / privacy
Generated with Claude Code