Skip to content

Use NI-specific age profiles for demographic targets#313

Merged
vahid-ahmadi merged 3 commits intomainfrom
fix/ni-age-demographics-64
Mar 31, 2026
Merged

Use NI-specific age profiles for demographic targets#313
vahid-ahmadi merged 3 commits intomainfrom
fix/ni-age-demographics-64

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
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 3 commits March 31, 2026 13:56
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>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi force-pushed the fix/ni-age-demographics-64 branch from a17dccf to 3a6c8ab Compare March 31, 2026 12:57
@vahid-ahmadi vahid-ahmadi merged commit 23429c4 into main Mar 31, 2026
3 checks passed
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