You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expand National Insurance documentation page (#746) (#1699)
* Expand National Insurance docs page (#746)
The existing page covered Classes 1, 2 and 4 and ended in two parameter
charts. Round it out with:
- Class 3 (voluntary) added to the modelling table now that ni_class_3
is exposed,
- a "How PolicyEngine computes National Insurance liability" section that
walks through the per-class variables and the household total,
- a References block (SSCBA 1992, HMRC rates page, HMRC outturn stats).
Also fix the chained boolean indexing in the rates chart cell, which was
triggering a pandas UserWarning ("Boolean Series key will be reindexed").
* Correct national_insurance rollup in NI docs
national_insurance sums ni_class_1_employee + ni_class_2 + ni_class_3 +
ni_class_4 directly (Class 3 is included), not ni_employee +
ni_self_employed. The separately-tracked item is the Class 1 employer
charge, not Class 3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Expand the National Insurance documentation page with a per-class computation section, add Class 3 (voluntary) to the modelling table, link the underlying variables, and add a references section; also fix the boolean-chain warning in the rates chart.
"\"Social Security Contributions and Benefits Act 1992 s. 8\",\n",
158
-
"\"Social Security and Benefits Act 1992 s. 11\",\n",
159
-
"\"Social Security and Benefits Act 1992 s. 15\",\n",
160
+
"\"Social Security Contributions and Benefits Act 1992 s. 11\",\n",
161
+
"\"Social Security Contributions and Benefits Act 1992 s. 13\",\n",
162
+
"\"Social Security Contributions and Benefits Act 1992 s. 15\",\n",
160
163
" ],\n",
161
164
"}\n",
162
165
"\n",
163
166
"df = pd.DataFrame(data)\n",
164
167
"df"
165
168
]
166
169
},
170
+
{
171
+
"cell_type": "markdown",
172
+
"metadata": {},
173
+
"source": "## How PolicyEngine computes National Insurance liability\n\nFor each person, PolicyEngine computes NI contributions class-by-class:\n\n- **Class 1 employee** (`ni_class_1_employee`): the sum of `ni_class_1_employee_primary` (main rate on earnings between the Primary Threshold and the Upper Earnings Limit) and `ni_class_1_employee_additional` (additional rate on earnings above the UEL).\n- **Class 1 employer** (`ni_class_1_employer`): paid on earnings above the Secondary Threshold; surfaced through the `ni_employer` variable.\n- **Class 2** (`ni_class_2`): a flat weekly rate paid by the self-employed with profits above the Small Profits Threshold.\n- **Class 3** (`ni_class_3`): a voluntary flat weekly rate; the variable is exposed but defaults to zero unless explicitly set.\n- **Class 4** (`ni_class_4`): main rate between the Lower and Upper Profits Limits plus additional rate above the UPL, capped at the published Class 4 maximum.\n\nThe individual total `national_insurance` sums the four employee and self-employed components directly — `ni_class_1_employee + ni_class_2 + ni_class_3 + ni_class_4` — so voluntary Class 3 contributions are included in the household-side liability. The convenience aggregates `ni_employee` (Class 1 employee only) and `ni_self_employed` (Class 2 + Class 4) are also exposed for reporting. The Class 1 *employer* charge (`ni_class_1_employer`, surfaced as `ni_employer`) is an employer-side cost rather than part of the individual's `national_insurance`, so it is tracked separately and feeds the government revenue aggregates on its own.\n\nParameters live in `policyengine_uk/parameters/gov/hmrc/national_insurance/` and the per-class formulas in `policyengine_uk/variables/gov/hmrc/national_insurance/`."
"- [Social Security Contributions and Benefits Act 1992](https://www.legislation.gov.uk/ukpga/1992/4/contents) — primary statute defining each NI class.\n",
2723
+
"- HMRC, [Rates and allowances: National Insurance contributions](https://www.gov.uk/government/publications/rates-and-allowances-national-insurance-contributions).\n",
0 commit comments