Construct CPS tax units from household records#824
Merged
Conversation
This was referenced Apr 25, 2026
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
Builds CPS tax units from ASEC household records instead of using Census
TAX_IDas the production tax-unit graph.Key points:
TAX_IDs in the staged CPS data path; PE-US infers tax-unit roles and filing statuses from the resulting graph.CENSUS_TAX_IDfor audit/comparison.census_documentedcomparison mode and two validation harnesses.Closes #815.
Validation
Structural comparison against the 2025 ASEC public person file for tax year 2024:
93.55%96.91%92.97%6.82%, constructed0.00%1.86%, constructed0.34%1.35%, constructed1.28%Outcome comparison holding staged CPS arrays fixed and swapping only tax-unit IDs:
1.12884 -> 1.127730.68472 -> 0.678522.45406 -> 2.401381.17441 -> 1.17380Commands run:
uv run ruff check policyengine_us_data/datasets/cps/census_cps.py policyengine_us_data/datasets/cps/cps.py policyengine_us_data/datasets/cps/tax_unit_construction.py policyengine_us_data/datasets/cps/tax_unit_rule_helpers.py tests/integration/test_census_cps.py tests/integration/test_cps.py tests/unit/datasets/test_cps_tax_unit_construction.py validation/cps_tax_unit_validation.py validation/cps_tax_unit_outcome_validation.pyuv run pytest tests/unit/datasets/test_cps_tax_unit_construction.py -quv run pytest tests/integration/test_census_cps.py -k 'resolve_person_usecols or fill_missing_optional_person_columns or create_tax_unit_table' -quv run pytest tests/integration/test_cps.py -k 'add_personal_variables or add_id_variables or validate_raw_cps_schema' -qPYTHONPATH=/Users/maxghenis/PolicyEngine/policyengine-us uv run python validation/cps_tax_unit_outcome_validation.py policyengine_us_data/storage/cps_2024.h5 /tmp/asecpub25csv.zip --csv-name pppub25.csv --year 2024 --output /tmp/cps_tax_unit_outcome_validation_ids_only.json