Skip to content

TST: Test missing categorical values in fitted models - #867

Merged
bashtage merged 1 commit into
mainfrom
followup-858-categorical-tests
Nov 6, 2026
Merged

bashtage merged 1 commit into
mainfrom
followup-858-categorical-tests

Conversation

@bashtage

@bashtage bashtage commented Nov 6, 2026

Copy link
Copy Markdown
Owner

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.

🤖 Generated with Claude Code

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 added a commit that referenced this pull request Nov 6, 2026
The follow-ups to #858, #859 and #862 (#867, #866, #865) and the Windows ARM64 job of the CI (#868).
@bashtage
bashtage marked this pull request as ready for review November 6, 2026 14:37
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (2be3f6c) to head (7fc6bc9).
⚠️ Report is 9 commits behind head on main.

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     
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.

@bashtage
bashtage merged commit 2f4e45c into main Nov 6, 2026
26 checks passed
@bashtage
bashtage deleted the followup-858-categorical-tests branch November 6, 2026 16:24
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.

1 participant