Conversation
Rebase and forge third-party contribution (wenddymacro) implementing Wooldridge (2025, 2023) Extended Two-Way Fixed Effects estimator. - OLS, logit, and Poisson QMLE paths with ASF-based ATT - Delta-method SEs for nonlinear models, cluster-robust sandwich - Four aggregation types (simple, group, calendar, event) - Fixed QMLE sandwich to use weight_type="aweight" for correct unweighted scores in bread computation - Added solve_poisson IRLS solver to linalg.py - Complete documentation: REGISTRY, README, CHANGELOG, tutorial - 60 tests covering all paths, edge cases, and methodology checks Co-Authored-By: wenddymacro <50739376+wenddymacro@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… P2s P0: Fix _filter_sample so control_group="never_treated" excludes pre-treatment observations from treated units. Previously both settings produced identical samples (treated_mask=cohort>0 kept all treated-unit obs regardless). Now never_treated restricts to post-treatment obs from treated units + all never-treated obs. P1: Add NaN checks in logit/Poisson ASF loops to skip cells whose interaction coefficients were dropped due to rank deficiency. Zero out NaN entries in beta before vcov computation. P2a: Validate bootstrap_weights in __init__ — invalid values now raise ValueError instead of silently falling through to Mammen. P2b: Fix n_control_units metadata to count not-yet-treated units when control_group="not_yet_treated" (was counting only cohort==0). P3a: Change bootstrap loop to return_vcov=False (only coefs used). P3b: Soften "matches Stata exactly" claims in tutorial to "follows the jwdid specification" with registry deviation note. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
Moving these changes to PR #216 (original contributor's PR) so @wenddymacro gets proper credit. |
Owner
Author
|
/ai-review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jwdid_estatweight_type="aweight"for correct unweighted scorescontrol_group="never_treated"to correctly exclude pre-treatment observations from treated units (P0 from AI review)solve_poissonIRLS solver tolinalg.pyMethodology references (required if estimator / math changes)
jwdid_estat(documented in REGISTRY.md)(G/(G-1))*(n-1)/(n-k)vs Stata'sG/(G-1)only — conservative, inflates SEs slightly (documented in REGISTRY.md and TODO.md)etwfeusesfixestfor nonlinear paths; this uses direct QMLE viacompute_robust_vcov(documented in REGISTRY.md)Validation
tests/test_wooldridge.py(63 tests),tests/test_linalg.py(4 solve_poisson tests)docs/tutorials/16_wooldridge_etwfe.ipynbdocs/methodology/papers/wooldridge-etwfe-review.mdSecurity / privacy
Generated with Claude Code