Repository navigation
BUG: Exclude implicit intercepts from panel and system F tests - #876
Open
Swapnil-byte-798 wants to merge 1 commit into
Open
Swapnil-byte-798 wants to merge 1 commit into
Swapnil-byte-798 wants to merge 1 commit into
Conversation
Test the coefficient restrictions that reduce the fitted model to a constant. Use the transformed constant in PanelOLS so the tests still work after a fixed effect absorbs one of the original dummy columns. Co-authored-by: Codex <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #876 +/- ##
========================================
Coverage 99.69% 99.69%
========================================
Files 202 203 +1
Lines 38871 38988 +117
Branches 2501 2511 +10
========================================
+ Hits 38752 38869 +117
Misses 51 51
Partials 68 68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Related to #780. The robust panel and system equation F tests can select the wrong null when the regressors jointly span an intercept. With two complementary dummies and a slope, the constant-only model has equal group effects and a zero slope. Dropping one dummy from the test instead imposes a zero group effect.
In the regression fixture, the pooled chi-square statistic falls from 165.136 to 5.632 on two degrees of freedom, matching the equivalent explicit-intercept design. With the F reference distribution, the corrected result also matches an independent statsmodels OLS fit (F = 2.7831, p = 0.06374).
The patch reuses the restriction construction from #859, keeping the existing covariance and reference distribution for each estimator. For
PanelOLS, the transformed constant also gives the correct classical F test whendrop_absorbed=Trueremoves a column that contributed to the intercept.Verification
d7980a7, 58 new cases fail and the singular-covariance control passes. On this branch, all 59 pass. Coverage includes weighted fits, rescaled dummies, Hotelling's test for FamaMacBeth, three fixed-effect solvers, and equations fitted by SUR, IV3SLS and IVSystemGMM.--skip-slow --skip-examples) reported 23,449 passed, 2,783 skipped and 47 expected failures. Changed-file Ruff, isort, Black, numpydoc and whitespace checks passed. The same 17 informational mypy diagnostics occur on the base and the patch.Codex assisted with implementation, testing, and this description.