Skip to content

Use NI-specific age profiles for demographic targets#313

Open
vahid-ahmadi wants to merge 2 commits intomainfrom
fix/ni-age-demographics-64
Open

Use NI-specific age profiles for demographic targets#313
vahid-ahmadi wants to merge 2 commits intomainfrom
fix/ni-age-demographics-64

Conversation

@vahid-ahmadi
Copy link
Collaborator

Summary

  • NI constituencies (18) and local authorities (10) were filled with the UK-wide mean age profile, ignoring that NI has a younger population than the UK average
  • Now uses country-specific mean profiles — for NI areas, the fill uses the NI national age distribution from ONS subnational projections rather than averaging across all England/Wales/Scotland areas
  • Updates both fill_missing_age_demographics.py scripts (constituency and LA) to group by country code prefix when computing fill values
  • Regenerates both age.csv files with corrected NI profiles
  • Scotland already had real constituency-level data from the House of Commons Library source, so no change needed there

Test plan

  • 6 unit tests: NI profiles differ from UK mean (constituency + LA), no missing data, Scotland has distinct profiles, NI young share exceeds UK average
  • CI passes (ruff, pytest)

Closes #64

🤖 Generated with Claude Code

vahid-ahmadi and others added 2 commits March 23, 2026 11:52
NI constituencies and local authorities were filled with UK-wide mean
age profiles, ignoring that NI has a younger population. Now uses
NI-specific age distribution from ONS subnational projections.

- Update fill_missing_age_demographics.py (both constituency and LA)
  to use country-specific means instead of UK-wide mean
- Regenerate age.csv files with NI-specific profiles
- Add 6 tests verifying NI profiles differ from UK mean, Scotland has
  distinct profiles, and NI young share exceeds UK average

Closes #64

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Document data sources in both README.md files: House of Commons
  Library, Nomis, ONS subnational projections, NISRA
- Expand from 6 to 13 tests: add expected counts, age-sum-to-all,
  no negatives, NI younger share (LA level), country presence checks

Co-Authored-By: Claude Opus 4.6 <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.

Improve demographic imputation for Scotland and Northern Ireland

1 participant