Skip to content

Use rules-based Medicare Part B in SPM medical out-of-pocket expenses#8104

Merged
MaxGhenis merged 1 commit intomainfrom
medicare-part-b-in-spm
Apr 19, 2026
Merged

Use rules-based Medicare Part B in SPM medical out-of-pocket expenses#8104
MaxGhenis merged 1 commit intomainfrom
medicare-part-b-in-spm

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Closes half of #8095.

Context

PolicyEngine-US already has a rules-based Medicare Part B premium variable: income_adjusted_part_b_premium (base premium + IRMAA surcharge by MAGI from 2 years prior, per filing status). It lives in `variables/gov/hhs/medicare/eligibility/part_b/`.

But it's currently orphaned — nothing consumes it. The imputed `medicare_part_b_premiums` is what flows into `medical_out_of_pocket_expenses` via `health_insurance_premiums`.

Fix

In `spm_unit_medical_out_of_pocket_expenses` (the SPM-unit-level wrapper introduced by #8103), subtract the imputed figure and add the rules-based one:

```python
return (
imputed_moop
- imputed_medicare_part_b_premiums
+ computed_income_adjusted_part_b_premium
+ chip_premium
)
```

Baseline SPM now uses statute-driven Part B premium rather than CPS-imputed (removes per-family CPS noise). Reforms to the base premium or IRMAA thresholds propagate through SPM poverty measurement — previously they affected computed `income_adjusted_part_b_premium` but that variable was unused.

Person-level `medical_out_of_pocket_expenses` is untouched, so state itemized medical deductions and SNAP excess medical continue to see the imputed CPS figure.

Testing

  • 2 new tests in `spm_unit_medical_out_of_pocket_expenses_medicare_part_b.yaml`: base-premium scenario and IRMAA surcharge scenario
  • Existing SPM wrapper tests unaffected
  • 6/6 SPM-MOOP tests pass locally

Caveats

This does not yet touch the Person-level `medical_out_of_pocket_expenses`. Doing so would swap the imputed figure for rules-based across all consumers (state deductions, SNAP, etc.), which is a larger change and warrants a separate PR once we confirm the rules-based figure matches CMS-aggregate calibration for baseline.

Test plan

  • Local tests pass
  • `make format` / `ruff check` clean
  • CI passes

Wires the existing `income_adjusted_part_b_premium` (base + IRMAA by
MAGI 2 years prior, per filing status) into
`spm_unit_medical_out_of_pocket_expenses` in place of the CPS-imputed
`medicare_part_b_premiums` that ships in person-level MOOP.

Subtracts the imputed figure and adds the rules-based figure so
per-family Medicare Part B in SPM resources is driven by statute, not
CPS noise, and reforms to the base premium or IRMAA thresholds (e.g.
moving the surcharge tier cutoffs) propagate through SPM poverty
measurement.

Person-level `medical_out_of_pocket_expenses` is unchanged; SNAP excess
medical deduction and state itemized medical deductions continue to
see the imputed person-level figure.

Closes half of #8095.
@MaxGhenis MaxGhenis merged commit 417652b into main Apr 19, 2026
9 of 13 checks passed
@MaxGhenis MaxGhenis deleted the medicare-part-b-in-spm branch April 19, 2026 20:26
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (05d5d97) to head (cbc6454).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #8104    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           18         1    -17     
  Lines          353        14   -339     
  Branches         4         0     -4     
==========================================
- Hits           353        14   -339     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

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