Repository navigation
Charge employer Class 1 NI at 15.05% in 2022-23 - #2227
Merged
Merged
Conversation
The Health and Social Care Levy Act 2021 s.5(2)(b) made the secondary percentage 15.05% for 2022-23. The Health and Social Care Levy (Repeal) Act 2022 s.2(1) kept it for earnings paid before 6 November 2022. The employer rate parameter held 13.8% throughout, while the employee main rate already carried the levy. Add 15.05% from 2022-04-06 and 13.8% from 2022-11-06. Model year 2022 reads the rate at 30 April (15.05%), the same convention as the employee main rate (13.25%); #1807 covers sampling against averaging. Move the employee main rate's levy value to the statutory 2022-04-06 (no change to any model year) and cite s.5(2)(a)(i). Put the employer references under metadata, where policyengine-core reads them. Tests: YAML cases for 2021-2023, property tests for the levy window, dates, uplift and the Repeal Act's 14.53%/12.73% annual equivalents, and 2022-23 back in the secondary threshold differential. Fixes #2226 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The baseline page credited the 1.25-point levy to the employee rate only and linked parameter lines that the rate edits shifted. Name both rates, the repeal from 6 November 2022 and the 30 April reading, and repoint the employer and employee main rate line anchors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 9, 2026 05:55
Collaborator
Author
Hand-off to the UK hub
|
Collaborator
Author
|
Landed by the UK hub on the gates (handed off by session local_f9672a1b).
|
MaxGhenis
added a commit
that referenced
this pull request
Oct 9, 2026
This was referenced Oct 9, 2026
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.
Fixes #2226
What changes
Employer (secondary) Class 1 NI now charges 15.05% in model year 2022 (2022-23), where it charged 13.8%.
class_1/rates/employer.yamlgains 15.05% from 2022-04-06 and 13.8% from 2022-11-06, citing both Acts.Annualisation follows the employee main rate
convert_to_fiscal_year_parametersreads each model year at 30 April unless a parameter setsfiscal_year_blend. The employee main rate is not blended: it reads 13.25% for 2022, although 12% applied from 6 November. The employer rate now follows the same convention and reads 15.05% for 2022. Neither parameter sets the flag, and a test pins that.Averaging is the per-parameter choice open in #1807. For 2022-23 the day-weighted averages are 14.53% (employer) and 12.73% (employee main): 214 days at the levy rate, 151 at the base rate. These match, to two decimal places, the rates the Repeal Act Sch para 5(3) sets for directors' annual earnings periods. A test checks both against an exact computation and against
fiscal_year_average, so a later move to blending has its target figures ready.Two related edits
metadata:. policyengine-core accepts onlyvalueandmetadataon a dated value (ParameterAtInstant._allowed_keys), so the barereference:keys were dropped with a warning.Invariants
These hold for the stored parameter files:
fiscal_year_averageagrees with the exact figure to 1e-9.These hold for the model:
test_ni_secondary_threshold.py,ni_class_1_employerequals rate × max(earnings − annual ST, 0), in exact arithmetic, in every year from 2015 to 2030. That now includes 2022-23 at 15.05%. Correct the 2015-16 and 2016-17 secondary threshold; pin the annual threshold to reg 11(3A)(b) in every year #2182 left 2022-23 out of this differential because of this gap.Tests
All runs were at
827312fa, through~/reviews/us-hub/scripts/heavy_run.shand/usr/bin/lockf -k …/subfleet-suites.lock, with-n 2.pytest -n 2 policyengine_uk/tests/test_ni_health_and_social_care_levy.py test_ni_secondary_threshold.py test_fiscal_year_parameters.py test_ni_class_1_age_properties.py test_parameter_metadata.py: 96 passed in 84 s.policyengine-core test policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance -c policyengine_uk: 99 passed.ruff formatandruff checkon the touched Python files: clean.make testsuite and the microsimulation-marked tests. The only other tests that name either rate aretest_parametric_reform_impacts.py(reforms in 2025) andtests/microsimulation/reforms_config.yaml(scored on 2029). This PR changes no value in those years. No YAML test outside the NI folder computes employer NI for 2022.Impact (real microsimulation runs)
Each figure is a weighted total from
Microsimulation.calculate. Each comes from two runs on the same file:origin/mainat9f92d53e7(baseline) and this branch at827312fa. Scripts and outputs are kept outside the repo.Released uk-data 1.58.0 (
enhanced_frs_2024_25.h5, sha2565ba399ea…, the only microdata in the 1.58.0 release manifest). The file holds years 2024 to 2030. A 2022 run on it returns £0 employment income, so this change cannot move any 2022 output from the released data."Identical" covers every total the script records: employment income, employer NI, employee NI,
gov_tax,gov_balance,household_net_incomeand the count of employer NI payers.2022 magnitude. The only released file with 2022-23 data is
enhanced_frs_2022_23.h5, still in the HF tree at tag 1.58.0 (sha256c0200a76…). It was last built by uk-data 1.16.1 in July 2025 and is not in the 1.58.0 manifest. The current model rejects four of its enum columns, so the run used a copy that maps each invalid value to the variable's default:Baseline and branch read the same copy.
ni_class_1_employer,ni_employer)gov_tax,gov_balancehousehold_net_income,ni_employee, employment incomeEmployer NI rises by a factor of 1.090580, the ratio 15.05 / 13.8, and the number of payers (24.98m) does not change. The levels come from a file built in July 2025. Both runs read that same file, so the difference between them isolates this PR's rate change.
2023 and later on a 2023-24 base. The 1.58.0 file cannot run 2023, so the same two code versions also ran on
enhanced_frs_2023_24.h5, still in the HF tree at tag 1.58.0 (sha256584ae33d…, last built by uk-data 1.55.10). It loads without changes. Every recorded total is identical between baseline and branch in each year from 2023 to 2030. Employer NI is £106.991bn in 2023, £115.541bn in 2024 and £182.756bn in 2030. 2022 has no data in this file.Not in this PR
class_1/rates/employee/additional.yaml) holds the levy's 3.25% until 2024-04-04. Repeal Act s.2(1) restored 2% from 6 November 2022, so model year 2023 reads 3.25% instead of 2%. Fixing it changes 2023 outputs, so it is left for a separate PR.axiom: TheAxiomFoundation/rulespec-uk#441 queued (rulespec-uk
uk/statutes/ukpga/1992/4/9.yaml#secondary_percentagehas only 15% from 2025-04-06; HSCL Act 2021 s.5 is not in the corpus, and signed encoder runs need approval)🤖 Generated with Claude Code