diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..efc9ab68 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Hours worked last week variable. \ No newline at end of file diff --git a/policyengine_us_data/datasets/cps/census_cps.py b/policyengine_us_data/datasets/cps/census_cps.py index ba71ee52..68b7c8cb 100644 --- a/policyengine_us_data/datasets/cps/census_cps.py +++ b/policyengine_us_data/datasets/cps/census_cps.py @@ -302,4 +302,5 @@ class CensusCPS_2018(CensusCPS): "PRCITSHP", "NOW_GRP", "POCCU2", + "A_HRS1", ] diff --git a/policyengine_us_data/datasets/cps/cps.py b/policyengine_us_data/datasets/cps/cps.py index 8750de6a..dd2fbb5e 100644 --- a/policyengine_us_data/datasets/cps/cps.py +++ b/policyengine_us_data/datasets/cps/cps.py @@ -306,7 +306,7 @@ def add_auto_loan_interest(self, cps: h5py.File) -> None: donor_data = donor_data.loc[ np.random.choice( donor_data.index, - size=100_000 if not test_lite else 100_000, + size=100_000 if not test_lite else 10_000, replace=True, p=donor_data.household_weight / donor_data.household_weight.sum(), ) @@ -541,6 +541,7 @@ def add_personal_income_variables( cps["employment_income"] = person.WSAL_VAL cps["weekly_hours_worked"] = person.HRSWK * person.WKSWORK / 52 + cps["hours_worked_last_week"] = person.A_HRS1 * person.WKSWORK / 52 cps["taxable_interest_income"] = person.INT_VAL * ( p["taxable_interest_fraction"]