Skip to content

Add student loan plan imputation#235

Merged
MaxGhenis merged 2 commits into
mainfrom
add-student-loan-plan-imputation
Nov 29, 2025
Merged

Add student loan plan imputation#235
MaxGhenis merged 2 commits into
mainfrom
add-student-loan-plan-imputation

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

  • Adds impute_student_loan_plan() function that assigns plan types based on age and reported student loan repayments
  • Integrates with the dataset creation pipeline in create_datasets.py
  • Uses policyengine-uk's StudentLoanPlan string enum values ("NONE", "PLAN_1", "PLAN_2", "PLAN_5")

Plan assignment logic

Based on estimated university start year (simulation year - age + 18):

  • Plan 1: Started before September 2012
  • Plan 2: Started September 2012 - August 2023
  • Plan 5: Started September 2023 onwards

Why this matters

This enables downstream projects (like uk-autumn-budget-dashboard) to use policyengine-uk's student_loan_repayment variable directly with official threshold parameters, rather than implementing custom student loan logic.

Test plan

  • Added unit tests for plan assignment logic
  • Added tests verifying StudentLoanPlan enum values match policyengine-uk
  • Tests pass locally

Fixes #234

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 28, 2025 18:48
Imputes student_loan_plan variable based on age and reported student loan
repayments. Plan type is assigned according to when the person likely started
university (age 18), using the transition dates:
- Plan 1: Started before September 2012
- Plan 2: Started September 2012 - August 2023
- Plan 5: Started September 2023 onwards

This enables policyengine-uk's student_loan_repayment variable to calculate
repayments using official threshold parameters without needing custom code
in downstream projects.

Fixes #234

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 2309a4a into main Nov 29, 2025
3 checks passed
MaxGhenis added a commit to PolicyEngine/uk-autumn-budget-dashboard that referenced this pull request Nov 29, 2025
policyengine-uk-data now imputes student_loan_plan based on age and
reported repayments. This removes the custom inference logic from the
dashboard, replacing it with a simpler function that just connects
policyengine-uk's student_loan_repayment variable to the tax/revenue totals.

Depends on: PolicyEngine/policyengine-uk-data#235

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
MaxGhenis added a commit to PolicyEngine/uk-autumn-budget-dashboard that referenced this pull request Nov 29, 2025
policyengine-uk-data now imputes student_loan_plan based on age and
reported repayments. This removes the custom inference logic from the
dashboard, replacing it with a simpler function that just connects
policyengine-uk's student_loan_repayment variable to the tax/revenue totals.

Depends on: PolicyEngine/policyengine-uk-data#235

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <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.

Add student_loan_plan imputation

1 participant