Repository navigation
TST: Test missing categorical values in fitted models - #867
Merged
Merged
Conversation
Follow-up to #858, which makes a missing value of a categorical column a missing value of its dummy variables, so that the observation is dropped instead of being kept as a row of zeros. - IV2SLS and PooledOLS fit with a categorical column that has missing values drop those observations with a MissingValueWarning, and their estimates equal those of a least-squares fit of the same model without the observations, with dummies from pandas.get_dummies. - A categorical column whose values are all missing keeps its dummy columns, and every observation is missing. This is the branch that codecov reported as uncovered in IVData and PanelData. - The missing values of several categorical columns of IVData are combined. The five new tests fail before #858. The convert_dummies parameter of IVData and PanelData now says how missing categorical values are converted, with a versionchanged note for 7.2.
bashtage
marked this pull request as ready for review
November 6, 2026 14:37
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #867 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 200 200
Lines 38076 38131 +55
Branches 2442 2442
=======================================
+ Hits 37955 38012 +57
Misses 51 51
+ Partials 70 68 -2
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.
Follow-up to #858, which makes a missing value of a categorical column a
missing value of its dummy variables, so that the observation is dropped
instead of being kept as a row of zeros.
drop those observations with a MissingValueWarning, and their estimates equal
those of a least-squares fit of the same model without the observations,
with dummies from pandas.get_dummies.
and every observation is missing. This is the branch that codecov reported
as uncovered in IVData and PanelData.
The five new tests fail before #858. The convert_dummies parameter of IVData
and PanelData now says how missing categorical values are converted, with a
versionchanged note for 7.2.
🤖 Generated with Claude Code