Skip to content

Add marginal_tax_rate_wrt_employer_cost (#45)#1641

Open
vahid-ahmadi wants to merge 1 commit intomainfrom
feat/marginal-tax-rate-wrt-employer-cost-45
Open

Add marginal_tax_rate_wrt_employer_cost (#45)#1641
vahid-ahmadi wants to merge 1 commit intomainfrom
feat/marginal-tax-rate-wrt-employer-cost-45

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a new person-level variable marginal_tax_rate_wrt_employer_cost that mirrors the existing marginal_tax_rate but uses the change in employer_cost (gross pay + employer NI + employer pension contributions + statutory sick/maternity/paternity pay) as the denominator. A pound of employer-side NI is therefore no longer invisible to the MTR.
  • Uses the same simulation-branching pattern as marginal_tax_rate: for each adult, branch, bump employment_income by the configured delta, recompute, and read both household_net_income and employer_cost in the branch.
  • Existing marginal_tax_rate is unchanged.

Closes #45.

Notes

  • This is the in-repo half. Surfacing the new variable through policyengine-api / policyengine-app is a separate change.
  • Like marginal_tax_rate, no YAML test is added — the branching pattern is not naturally unit-testable through the standard yaml harness.

Test plan

  • ruff format + ruff check on the new file.
  • Variable registers with the tax-benefit system (system.variables import check).
  • Full CI (make test) on this branch.
  • Sanity-check against marginal_tax_rate for a household with no employer NI liability — the two MTRs should match.

🤖 Generated with Claude Code

Mirror the existing `marginal_tax_rate` variable but divide the change
in household net income by the change in the employer's cost of
employment rather than the change in gross pay. The denominator is
`employer_cost` (gross pay plus employer NI, employer pension
contributions, and statutory sick/maternity/paternity pay), so a pound
of employer-side NI is no longer invisible to the MTR.

Computation uses the same simulation-branching pattern as
`marginal_tax_rate` — for each adult, branch the simulation, bump
`employment_income` by the configured delta, recompute, and read both
`household_net_income` and `employer_cost` in the branch. Division-by-
zero is guarded for people whose employer cost happens not to move.

No change to the existing `marginal_tax_rate` variable. Downstream
surfaces (API, household calculator) would need a separate change to
expose the new variable to end users.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi self-assigned this Apr 21, 2026
@vahid-ahmadi vahid-ahmadi requested a review from MaxGhenis April 21, 2026 11:14
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 employer NI in MTR calculations

1 participant