PolicyEngine / PolicyEngine/policyengine-uk-data
EDUCQUAL mapping is inverted against the current FRS codeframe
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 2
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 4
Description
The EDUCQUAL_MAP in datasets/frs.py reads the FRS highest-qualification codeframe upside down: it assigns code 1 to NOT_COMPLETED_PRIMARY and codes 17–21 to TERTIARY, but recent FRS EDUCQUAL is the harmonised frame that starts at 1 = Doctorate and descends. highest_education feeds live model logic (maintenance loan system assignment, DSA course eligibility, student loan plan assignment), so this ships in production today.
Disclosure-safe evidence from the FRS 2023-24 adult tab (28,590 adults; aggregates only):
- code 1: 1.8% of adults, the highest mean weekly earnings of any code (~£744) — consistent with Doctorate/MPhil, absurd for "not completed primary"
- code 2: 10.4% at ~£643 (Masters/postgrad); code 3: 20.7% at ~£559 (first degree)
- codes 18/19 (mapped TERTIARY today): fewer than 10 respondents each — they are the Welsh/Scottish Baccalaureate niche codes, not "second/higher degree"
- the GCSE band (36–82 in the current frame) carries the population mass the inverted map displaces; code 66 (O-level, fewer than 5) is 3.6% at ~£157
Under the current map the weighted TERTIARY share of persons comes out around 10%, implausible for the UK (~28% under the corrected frame).
An unmerged fix with the corrected labels already exists on feat/impute-below-threshold-borrowers (8f95629, "Fix EDUCQUAL mapping - codes were inverted"); the evidence above independently confirms it against the 2023-24 tabs. The microcosm migration has adopted the corrected frame as a signed difference in PolicyEngine/microcosm#703 (workstream E3), so landing the fix here keeps the two pipelines aligned.
🤖 Generated with Claude Code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in datasets/frs.py by inspecting EDUCQUAL_MAP and compare it with the corrected labels in commit 8f95629 on feat/impute-below-threshold-borrowers. Confirm that the mapping matches the current FRS frame and preserves the downstream highest_education behavior used for loan and DSA assignments; done means the corrected frame is applied here and remains aligned with microcosm PolicyEngine/microcosm#703.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100