Skip to content

Add ONS Family Spending by income decile, FYE 2025 (#446) - #450

Merged
juaristi22 merged 3 commits into
mainfrom
uk-family-spending-income-446
Nov 27, 2026
Merged

juaristi22 merged 3 commits into
mainfrom
uk-family-spending-income-446

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Closes #446.

Adds ons-family-spending-workbook1-fye2025, 487 facts from ONS's Family spending workbook 1:
detailed expenditure and trends
, financial year ending (FYE) 2025 edition, released 11 June 2026.
PolicyEngine/microcosm#1717 reads these as the official reference for its comparison of imputed
spending with the Living Costs and Food Survey by decile.

Workbook

The issue names workbook 2. Its FYE 2025 edition has decile tables only by gross income (Table A4)
and by unequivalised disposable income (Table A7), and its equivalised tables are quintiles of
one-adult and two-adult non-retired households. The equivalised decile table for all households is
workbook 1's Table 3.1E, which prints both equivalisation versions side by side. Workbook 1's Table
A6 gives the gross income deciles. So the package pins workbook 1
(workbook1detailedexpenditureandtrends.xlsx, 558,943 bytes, OGL v3.0).

Facts

  • ons.family_spending.mean_weekly_household_expenditure (£ a week, mean): 425 facts. Rows are the
    COICOP divisions 1 to 12, their total, other expenditure items (13) and total expenditure.
  • ons.family_spending.weighted_households (printed in thousands): 31 facts.
  • ons.family_spending.households_in_sample (unweighted): 31 facts.
  • The blocks:
    • Table 3.1E, updated OECD-modified scale (2-adult reference), ten deciles;
    • Table 3.1E, OECD-modified scale (1-adult reference), ten deciles;
    • Table A6, gross income, ten deciles;
    • all households, read once because the column is identical in the three blocks.
  • Dimensions: expenditure_group, income_decile_group, income_decile_basis and, on equivalised
    facts, equivalence_scale.
  • UK private households, fiscal_year 2024 (FYE 2025), survey_aggregate from the Living Costs and
    Food Survey.
  • Cells ONS suppresses ("..", fewer than 10 reporting households) carry no fact: Education in every
    decile, and Health in every gross income decile. No selected cell carries another marker.

scripts/build_uk_446_packages.py writes the package from the pinned workbook with Chronicle's own
parser. Field contracts and caveats are in
docs/data-sources/uk-family-spending-income-deciles-446.md.

Checks

  • tests/test_source_uk_446_family_spending.py:
    • every fact equals its workbook cell (read with openpyxl), and suppressed cells have no fact;
    • categories 1 to 12 plus 13 equal total expenditure to within £0.10 in every column;
    • the deciles' weighted households and sample sizes add up to the all-household figures within
      rounding;
    • pinned published figures, the generator, the manifest, the label register and the build at
      bundle year 2023.
  • tests/test_chronicle_bundle.py: +487 facts (UK households, FYE 2025), one package and one table.
    The package was measured alone at bundle year 2023: no new geography, period or entity key,
    duplicate key or warning.

In R2

The workbook is in the private ledger-raw bucket (publish-raw, then verify-raw: verified).

🤖 Generated with Claude Code

Pin ONS's Family spending workbook 1 (financial year ending 2025 edition,
released 11 June 2026) and add ons-family-spending-workbook1-fye2025: 487
facts of mean weekly household expenditure by commodity group, with each
decile's weighted households and sample size, by equivalised disposable
income decile in both equivalisation versions (Table 3.1E) and by gross
income decile (Table A6). Cells ONS suppresses carry no fact. The issue
names workbook 2, which has no equivalised decile table for all households.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick pass. I found nothing blocking.

What I checked at 80afb29

  • tests/test_source_uk_446_family_spending.py: 15 passed locally, and scripts/build_uk_446_packages.py --check exits 0.
  • The committed workbook's sha256 matches the manifest (af8d4a44…1076).
  • I read Tables A6 and 3.1E with openpyxl myself. The division rows, "All expenditure groups", category 13 and total expenditure match what the package claims, including the pinned figures: £676.60 for all households, £377.10, £380.10 and £291.30 for the lowest decile in the three blocks, and £1,243.20 for the top updated-scale decile.
  • The count adds up. Spending is 31 columns × 15 rows = 465 cells, less 30 Education cells (every decile of the three blocks) and 10 Health cells (the gross income deciles), which gives 425. Each of the two counts has 31 facts, so the total is 487.
  • Health really is ".." in every A6 decile while 3.1E prints it, so the asymmetry comes from ONS, not from the parser.
  • fiscal_year 2024 with coverage from 2024-04-01 to 2025-03-31 follows the same convention as the existing Scottish Band D package (period 1996 for 1996-97).
  • Choosing workbook 1 over workbook 2 makes sense: workbook 2 has no equivalised decile table for all households.

Two notes for the consumer, microcosm#1717. Neither needs a change here unless you want it.

  1. Which spending total to compare. #1717 sums the twelve imputed divisions (p601–p612). The matching concept is expenditure_group: coicop_01_to_12 ("All expenditure groups"), not total_expenditure, which adds category 13 (mortgage interest, council tax and other items outside consumption). In the bottom equivalised decile that is £335.50 against £377.10, about 11% apart. It would be worth one line in the doc's Semantics section so nobody picks the wrong row.
  2. Geography and scale. These facts are UK, and #1717's comparison is GB, so a reader matching the two needs that caveat. On the scale, HBAI's modified OECD scale has a couple as its reference household, so it matches the updated_oecd_modified_2_adult_reference block. Ranking happens to differ little between the two 3.1E blocks (£377.10 against £380.10 in the bottom decile).

CI: "Chronicle bundle" and "Chronicle surface" were still pending at this head when I looked. The branch merges cleanly into main.

Review drafted with AI assistance and checked against the code at 80afb29d3eef6f6651d03ee99380a362a430669e.

Vahid's review of #450: a sum of the twelve COICOP divisions corresponds to
coicop_01_to_12, not total_expenditure, which also includes category 13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juaristi22
juaristi22 marked this pull request as ready for review November 26, 2026 13:24
The merged bundle test pins country:K02000001's fact count. chronicle#446's
487 facts are all for the United Kingdom: CI read 110,450 against the pinned
109,963.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juaristi22
juaristi22 merged commit e4d46c9 into main Nov 27, 2026
3 checks passed
juaristi22 added a commit to PolicyEngine/microcosm that referenced this pull request Nov 27, 2026
…beside the LCFS decile receipt (#1717)

PolicyEngine/chronicle#450 adds ONS Family Spending, financial year ending
2025 (workbook 1, Tables 3.1E and A6). It is the official reference #1717
asked for beside the LCFS stage's frame-against-donor decile comparison.

- The UK feed is re-pinned to 4e7d7746, #450's head on Chronicle main
  ece6bb29: 2,160,837 rows, against 15040ea5's 2,160,350. The surfaces were
  regenerated in docs/uk-chronicle-feed-repin.md's order.
  - Every 15040ea5 row is byte-identical, and the 487 new rows are #450's.
  - The national references and both compile-parity receipts are
    byte-identical.
  - The other surfaces change only their feed identity. The DESNZ
    constituency resource keeps its 2,526 values, with new keys.
  - The local references gain the CenTax hierarchy category that #1399
    declared.
- The new vendored ons_family_spending_income_decile_facts.json (133 rows)
  holds Table 3.1E's deciles on the updated OECD-modified scale and all
  households. The country package and the LCFS stage declare it.
- family_spending_by_decile() reads it. For each decile, in total and by
  division, decile_fit sets the published weekly mean and its shape beside
  the frame's and the donor's own profiles. A profile is each decile's mean
  over its deciles 4 to 7. The reading is report-only: an unavailable table
  records its reason.
- On the licensed stage replay:
  - the donor's profile sits within 0.93 to 1.10 of the published shape in
    every decile, with the bottom decile at 0.98;
  - the frame's bottom decile sits at 1.13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22 added a commit to PolicyEngine/microcosm that referenced this pull request Nov 27, 2026
PolicyEngine/chronicle#450 merged into Chronicle main as e4d46c93, onto an unmoved base, so the merge commit's tree is
the pull request head's (4e7d7746). The consumer artifact's manifest records no commit, so the artifact built from that
head is the merge commit's. The pin and every surface that restates the feed identity move to the merge commit, as
microcosm#1421 moved from PolicyEngine/chronicle#392's head to its merge.

- Every vendored resource changes only its pin stamps.
- The DESNZ constituency resource keeps its 2,526 rows and values, with new keys and build date.
- The local membership also moves the DESNZ cells' derived fact keys, and the local census restates the DESNZ
  resource's new digests.
- The release input coverage manifest and the H2 fixture move only their digests.
- The national and local references and both compile-parity receipts record no commit and are unchanged.
- The pin tests, the runbook entry and the changelog fragment name e4d46c93.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

UK household spending by income decile: ONS Family Spending (PolicyEngine/microcosm#1717)

2 participants