Skip to content

BUG: Exclude implicit intercepts from panel and system F tests - #876

Open
Swapnil-byte-798 wants to merge 1 commit into
bashtage:mainfrom
Swapnil-byte-798:fix/implicit-intercept-f-tests
Open

Swapnil-byte-798 wants to merge 1 commit into
bashtage:mainfrom
Swapnil-byte-798:fix/implicit-intercept-f-tests

Conversation

@Swapnil-byte-798

Copy link
Copy Markdown

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 when drop_absorbed=True removes a column that contributed to the intercept.

Verification

  • On upstream 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.
  • The full standard test selection (--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.

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]>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (d7980a7) to head (32a937d).

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            
Flag Coverage Δ
adder 99.68% <100.00%> (+<0.01%) ⬆️
subtractor 99.68% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants