Add student loan plan imputation#235
Merged
Merged
Conversation
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
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>
3 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
impute_student_loan_plan()function that assigns plan types based on age and reported student loan repaymentscreate_datasets.pyStudentLoanPlanstring enum values ("NONE","PLAN_1","PLAN_2","PLAN_5")Plan assignment logic
Based on estimated university start year (simulation year - age + 18):
Why this matters
This enables downstream projects (like uk-autumn-budget-dashboard) to use policyengine-uk's
student_loan_repaymentvariable directly with official threshold parameters, rather than implementing custom student loan logic.Test plan
StudentLoanPlanenum values match policyengine-ukFixes #234
🤖 Generated with Claude Code