Skip to content

Add decomposed marginal tax rate variables (federal, state, FICA)#7791

Open
PavelMakarchuk wants to merge 5 commits intomainfrom
add-decomposed-marginal-tax-rates
Open

Add decomposed marginal tax rate variables (federal, state, FICA)#7791
PavelMakarchuk wants to merge 5 commits intomainfrom
add-decomposed-marginal-tax-rates

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

Closes #7790

  • Adds federal_marginal_tax_rate — marginal change in federal income tax per dollar of additional earnings
  • Adds state_marginal_tax_rate — marginal change in state income tax per dollar of additional earnings
  • Adds fica_marginal_tax_rate — marginal change in employee payroll tax per dollar of additional earnings

These enable apples-to-apples comparison with TAXSIM-35 outputs (frate, srate, ficar) and are independently useful for decomposing where marginal rates come from.

Each variable follows the same counterfactual branch pattern as marginal_tax_rate (perturb earnings by delta, measure change in specific tax component), with unique branch names to avoid conflicts.

Test plan

  • 4 YAML tests: federal MTR in 22% bracket, zero state MTR in TX, FICA below SS wage base (7.65%), FICA above SS wage base with Additional Medicare Tax (2.35%)
  • Existing marginal_tax_rate tests still pass
  • make format passes

🤖 Generated with Claude Code

PavelMakarchuk and others added 5 commits March 17, 2026 11:45
Closes #7790

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use person.household.sum() with is_tax_unit_head filter for
  consistency with how marginal_tax_rate uses household_net_income
- Add married couple and multi-tax-unit household tests for each
  variable (15 tests total)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review March 17, 2026 16:31
@PavelMakarchuk PavelMakarchuk requested review from MaxGhenis and removed request for MaxGhenis March 17, 2026 16:32
@PavelMakarchuk PavelMakarchuk marked this pull request as draft March 17, 2026 16:33
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (19ec305) to head (be7934b).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7791   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         4    +1     
  Lines           33        61   +28     
  Branches         0         3    +3     
=========================================
+ Hits            33        61   +28     
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.

Add decomposed marginal tax rate variables (federal, state, FICA)

1 participant