Repository navigation
Add eligibility across income measures to the analysis and dashboard - #3
Conversation
Ranks GB households by five baseline incomes: equivalised HBAI net income before and after housing costs (policyengine-uk's modified OECD scale), the same net income without the size adjustment, and household taxable income (members' total_income summed). For each it reports, in household-weighted deciles with ties kept together: - how households qualify (passported, income test alone, not at all), their share of spending and average gain; - 5x5 quintile cross-tabulations of equivalised against unequivalised income; - three groups: households in deciles 1-3 that do not qualify, and households in deciles 6-10 that qualify through the income test alone or through passporting, with their size, poverty, incomes and make-up. The frame gains household taxable income, members with income, the second-highest income and the AHC equivalisation factor. Computed for each preset's published run (eligibility does not depend on the amounts); existing results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the main tab's reach and targeting area: - who qualifies by household decile on equivalised, household net or household taxable income (before or after housing costs), with spending and average gain on the standard decile chart; - a cross-tab heatmap of equivalised against unequivalised income; - the three groups where eligibility and income diverge, their make-up, and a comparison with the other rules. The Methodology tab explains how policyengine-uk equivalises income and defines the measures and groups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… terms - Poverty: separate toggles for the poverty line (absolute, relative) and housing costs (before, after), defaulting to absolute poverty before housing costs; the headline card uses the same measure. - Region and household-type rows are ordered by the passported share, the first segment of each bar. - The income cut-offs section is removed. Instead, "Your household" charts the discount as one adult's taxable income changes, with the current income marked and the steps described in words (supportCurve and supportSteps in lib/calculator.js, with tests). - Neutral terms throughout: "dead zone" becomes the offset range (the band above a line where extra income after tax is below the support lost), "struggling" becomes poverty or high energy costs, "poor"/"missed" become in poverty/not reached, and "gets nothing" becomes "does not qualify". Result keys are renamed to match; stored results were rewritten with the renames and receipts regenerated, and a fresh computation matches them. - The dashboard export drops the cut-off data it no longer shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Automated review pass (Claude Code, high effort) — round 1 at
|
- Export the lowest-three-decile group on deciles of people (person_deciles), so the README's person-weighted figure traces to the results. - coverage() adds absolute and relative poverty and the four lowest deciles before housing costs; the reach bars get a housing-costs toggle defaulting to before. - Cells and groups with 1-9 survey records are blanked in the analysis (MIN_RECORDS), keeping position and record count; the heatmap shows them as not shown. - README: the largest group, the £24,000-£24,500 taxable band, cut-off counts are receipts-only, both datasets for the person-weighted count, "does not reach". - Results for 2024, 2026 and 2027 regenerated; every pre-existing figure unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Vahid. All seven are addressed in fe63c26.
I also replaced the three remaining "misses" in the README with "does not reach". Checks
The failing "Vercel – uk-energy-reforms" check doesn't come from this PR. It is a second Vercel project imported at the repo root, which Vercel detected as Python. It will stop reporting once that project is removed or disconnected. |
The dashboard keeps who qualifies by decile on each income measure. The cross-tabulations and the three divergence groups stay in the analysis results and receipts, to be shared as files on request, and leave the dashboard export, so the data file falls from 2.25 MB to 1.71 MB. The heatmap component and its helpers go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Short sticky title bar and full-width intro with links - Dropdowns replace pill toggles; one card width throughout - Poverty and inequality side by side; inequality as a bar chart - Chart footers merged; legends centred below each chart - Lower-income reach section collapsible, controls grouped with its charts - Household tab: result card merged, styled inputs and benefit chips - Baseline tab fixed to 2026-27; RF comparison redesigned with gaps - Data coverage and unreproduced figures moved to the methodology - Footer centred Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- RF diamond drawn hollow above the PE dot so overlapping markers stay visible - Official statistics comparison moved last and shown as labelled rows - Methodology detail text uses the full card width Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tidy dashboard layout, controls and explanations
Make dashboard results and methodology easier to explore
Review — round 2 at
|
Summary
This PR adds an analysis of how the targeted energy discount's eligibility rules line up with household income. It shows which households the rules leave out lower down the income distribution and which they reach higher up.
The income test looks at one person's taxable income. This PR ranks households by five wider measures of household income instead:
It then breaks down how households qualify across each distribution. On the dashboard this appears as a collapsible section at the end of the Economic impact tab, titled "Does the discount reach lower-income households?". The cross-tabulations and the three divergence groups stay in the analysis results and receipts, to be shared as files on request. They are not on the dashboard.
The branch also contains the dashboard redesign from #4 and #5, which were stacked on it and merged into it. The dashboard now has four tabs: Economic impact, Your household, Baseline and Methodology.
How PolicyEngine equivalises income
equiv_hbai_household_net_incomeand its_ahctwin. Gross and taxable income never are.household_income_decileranks people by equivalised income before housing costs.Changes
Analysis
simulate.py: the household frame gains household taxable income, the number of members with taxable income, the second-highest member's income and the AHC equivalisation factor.analysis.income_distributions. It uses household-weighted deciles, so each holds a tenth of GB households, and tied incomes share a decile. For each of the five measures it reports:person_deciles).Cells and groups with fewer than 10 survey records are blanked (
MIN_RECORDS), keeping their position and record count.Which runs get it. It is computed for every run: each option, payment basis (RF's amounts, bill share, £2bn budget), year and dataset, 60 combinations in all. Eligibility is the same across payment bases. Spending and gains follow each run's own payments.
coverage()adds absolute and relative poverty and the four lowest deciles before housing costs. The after-housing-costs rows are unchanged.Unchanged figures. Apart from the key renames below, every result field stored on
mainis unchanged.Receipts and export
report.pyadds, to each receipt:dashboard_data.pyexports a roundeddistributionsblock with the deciles only..gitattributesmarks the generated JSON as generated, so it stays collapsed in review.Dashboard
Economic impact:
Your household:
supportCurveandsupportStepsinlib/calculator.js, with tests.Baseline:
Methodology:
Across tabs:
Neutral terms:
Result keys are renamed to match.
Export: the dashboard export drops the cut-off data it no longer shows. The population counts at the lines and the offset range stay in the receipts and the README.
Write-up
Findings (flat option, 2026-27, Microcosm / Enhanced FRS, equivalised income before housing costs)
Testing
uv run pytest: 35 passed. New tests cover:bun run test: 228 passed. New tests cover:bun run lint,ruff check,ruff format --checkandbun run buildare clean.uk-energy-reformscheck has been deleted.mainredeploys the production dashboard.🤖 Generated with Claude Code