From ebf1fcccca99f9133846e6a223a648bb7fcdbc78 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 22 Aug 2026 17:17:05 +0200 Subject: [PATCH] Add CPS work-experience person input variables Adds three person-level input variables from the CPS ASEC work-experience block, mirroring detailed_occupation_recode (POCCU2): - detailed_industry_recode: WEIND, industry of longest job by detailed groups (0:23) - major_industry_recode: WEMIND, industry of longest job by major industry groups (0:15) - worked_last_year: WKSWORK > 0, the universe condition of the work-experience longest-job recodes (measured across the 2023-2025 ASEC archives: WEIND in 1..22 iff WKSWORK > 0 with zero violations, while WORKYN = 1 misses ~600 allocation rows per year) Verified against the official ASEC public-use data dictionary (asec2024_ddl_pub_full.pdf). These are the engine-side consumers for the microcosm work_experience_inputs source stage (PolicyEngine/microcosm#719), which the Living Wage Institute MVP person schema requires (working indicator + industry + occupation). Co-Authored-By: Claude Fable 5 --- .../work-experience-person-inputs.added.md | 1 + .../person/detailed_industry_recode.py | 11 +++++++++++ .../demographic/person/major_industry_recode.py | 11 +++++++++++ .../demographic/person/worked_last_year.py | 15 +++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 changelog.d/work-experience-person-inputs.added.md create mode 100644 policyengine_us/variables/household/demographic/person/detailed_industry_recode.py create mode 100644 policyengine_us/variables/household/demographic/person/major_industry_recode.py create mode 100644 policyengine_us/variables/household/demographic/person/worked_last_year.py diff --git a/changelog.d/work-experience-person-inputs.added.md b/changelog.d/work-experience-person-inputs.added.md new file mode 100644 index 00000000000..d6a10718e13 --- /dev/null +++ b/changelog.d/work-experience-person-inputs.added.md @@ -0,0 +1 @@ +Detailed and major industry recode and worked-last-year person input variables from the CPS ASEC work-experience block (WEIND, WEMIND, WORKYN). diff --git a/policyengine_us/variables/household/demographic/person/detailed_industry_recode.py b/policyengine_us/variables/household/demographic/person/detailed_industry_recode.py new file mode 100644 index 00000000000..3138cdc984e --- /dev/null +++ b/policyengine_us/variables/household/demographic/person/detailed_industry_recode.py @@ -0,0 +1,11 @@ +from policyengine_us.model_api import * + + +class detailed_industry_recode(Variable): + value_type = int + entity = Person + label = "CPS detailed industry recode of previous year" + documentation = ( + "This variable is the WEIND variable in the Current Population Survey." + ) + definition_period = YEAR diff --git a/policyengine_us/variables/household/demographic/person/major_industry_recode.py b/policyengine_us/variables/household/demographic/person/major_industry_recode.py new file mode 100644 index 00000000000..a38879d4dc1 --- /dev/null +++ b/policyengine_us/variables/household/demographic/person/major_industry_recode.py @@ -0,0 +1,11 @@ +from policyengine_us.model_api import * + + +class major_industry_recode(Variable): + value_type = int + entity = Person + label = "CPS major industry recode of previous year" + documentation = ( + "This variable is the WEMIND variable in the Current Population Survey." + ) + definition_period = YEAR diff --git a/policyengine_us/variables/household/demographic/person/worked_last_year.py b/policyengine_us/variables/household/demographic/person/worked_last_year.py new file mode 100644 index 00000000000..ecda199c213 --- /dev/null +++ b/policyengine_us/variables/household/demographic/person/worked_last_year.py @@ -0,0 +1,15 @@ +from policyengine_us.model_api import * + + +class worked_last_year(Variable): + value_type = bool + entity = Person + label = "worked at any time in the previous year" + documentation = ( + "Whether the person worked at any time during the previous year: " + "the WKSWORK variable in the Current Population Survey exceeding " + "zero, which is the universe condition of the work-experience " + "longest-job recodes (detailed_occupation_recode, " + "detailed_industry_recode, major_industry_recode)." + ) + definition_period = YEAR