ENH: Add Cragg-Donald test of reduced rank for first-stage regression (#622) - #713
Open
AyuG619 wants to merge 1 commit into
Open
ENH: Add Cragg-Donald test of reduced rank for first-stage regression (#622)#713AyuG619 wants to merge 1 commit into
AyuG619 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 101 101
Lines 17426 17488 +62
Branches 1430 1432 +2
=======================================
+ Hits 17347 17409 +62
Misses 29 29
Partials 50 50
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 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
Implements the Cragg-Donald test of reduced rank for the first-stage
regression, addressing issue #622. With multiple endogenous variables,
the existing per-variable first-stage F-statistics can be individually
large even when the instruments cannot jointly identify all endogenous
regressors (e.g., when their fitted values are highly correlated). This
adds a joint diagnostic that correctly flags that failure mode.
Implementation
cragg_donaldfunction inlinearmodels.iv.common, alongside theexisting
f_statistic.cragg_donaldcached property onFirstStageResults, alongsidethe existing
diagnosticsproperty.annihilate/projutilities for partialling outexogenous regressors and projecting onto instruments, consistent with
other diagnostics in this module.
WaldTestStatistic/InvalidTestStatistic, matching existingconventions (e.g.
sargan,wu_hausman,f_statistic).(Anderson 1951), not Stock-Yogo (2005) finite-sample critical values,
which require choosing a tolerance for maximal size distortion/bias
and so are intentionally left out of scope.
Testing
(mlondschien/ivmodels) on the exact example data from IV2SLS
first_stagereports "wrong" first stage F-statistic #622, matchingto ~10 significant figures.
endogenous regressors) -- the latter caught by running the existing
result_checker-based test suite in test_results.py, which exercises
the OLS-like (no endogenous/instruments) fit path across all four IV
estimator types.
passes with no regressions.
Closes #622