From 394cf45ccaa37f58db3e41c4e7ee5eb691c63d14 Mon Sep 17 00:00:00 2001 From: Daphne Hansell <128793799+daphnehanse11@users.noreply.github.com> Date: Fri, 6 Feb 2026 09:35:29 -0500 Subject: [PATCH 1/4] Add ACA Premium Tax Credit (PTC) targets from IRS SOI CD-level data The SOI 22incd.csv file contains PTC count (N85530) and amount (A85530) columns at national, state, and congressional district levels, but they were not being ingested. This adds PTC to the existing IRS conditional strata pipeline so calibration can target PTC dollar amounts by geography. Co-Authored-By: Claude Opus 4.6 --- .../fit_calibration_weights.py | 1 + policyengine_us_data/db/DATABASE_GUIDE.md | 2 +- policyengine_us_data/db/etl_irs_soi.py | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/policyengine_us_data/datasets/cps/local_area_calibration/fit_calibration_weights.py b/policyengine_us_data/datasets/cps/local_area_calibration/fit_calibration_weights.py index b22b8eb4..995a52ab 100644 --- a/policyengine_us_data/datasets/cps/local_area_calibration/fit_calibration_weights.py +++ b/policyengine_us_data/datasets/cps/local_area_calibration/fit_calibration_weights.py @@ -110,6 +110,7 @@ "health_insurance_premiums_without_medicare_part_b", "snap", "state_income_tax", # Census STC state income tax collections + "aca_ptc", # ACA Premium Tax Credit from IRS SOI ], }, ) diff --git a/policyengine_us_data/db/DATABASE_GUIDE.md b/policyengine_us_data/db/DATABASE_GUIDE.md index ac038cb7..a9f8f398 100644 --- a/policyengine_us_data/db/DATABASE_GUIDE.md +++ b/policyengine_us_data/db/DATABASE_GUIDE.md @@ -110,7 +110,7 @@ The `stratum_group_id` field categorizes strata: | 5 | Medicaid | Medicaid enrollment strata | | 6 | EITC | EITC recipients by qualifying children | | 7 | State Income Tax | State-level income tax collections (Census STC) | -| 100-118 | IRS Conditional | Each IRS variable paired with conditional count constraints | +| 100-119 | IRS Conditional | Each IRS variable paired with conditional count constraints (includes ACA PTC at 119) | ### Conditional Strata (IRS SOI) diff --git a/policyengine_us_data/db/etl_irs_soi.py b/policyengine_us_data/db/etl_irs_soi.py index ed4da4e5..cc718994 100644 --- a/policyengine_us_data/db/etl_irs_soi.py +++ b/policyengine_us_data/db/etl_irs_soi.py @@ -281,6 +281,7 @@ def transform_soi_data(raw_df): dict(code="18425", name="salt", breakdown=None), dict(code="06500", name="income_tax", breakdown=None), dict(code="05800", name="income_tax_before_credits", breakdown=None), + dict(code="85530", name="aca_ptc", breakdown=None), ] # National --------------- @@ -566,6 +567,28 @@ def load_soi_data(long_dfs, year): units="dollars", ) + # ACA Premium Tax Credit + ptc_group = get_or_create_variable_group( + session, + name="aca_ptc_recipients", + category="tax", + is_histogram=False, + is_exclusive=False, + aggregation_method="sum", + display_order=9, + description="ACA Premium Tax Credit recipients and amounts", + ) + + get_or_create_variable_metadata( + session, + variable="aca_ptc", + group=ptc_group, + display_name="Premium Tax Credit", + display_order=1, + units="dollars", + notes="ACA Premium Tax Credit amount from IRS SOI", + ) + # Fetch existing geographic strata geo_strata = get_geographic_strata(session) From cf3969772eb72e91c337187a83d1dc0133de5ba2 Mon Sep 17 00:00:00 2001 From: Daphne Hansell <128793799+daphnehanse11@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:12:52 -0500 Subject: [PATCH 2/4] Add changelog entry for PTC targets Co-Authored-By: Claude Opus 4.6 --- changelog.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.yaml b/changelog.yaml index 3fb45a92..940780df 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -803,3 +803,9 @@ fixed: - Fix etl_state_income_tax.py API mismatches with db_metadata utility functions date: 2026-02-01 20:58:21 +- bump: minor + changes: + added: + - Add ACA Premium Tax Credit (PTC) targets from IRS SOI CD-level data (N85530/A85530) + at national, state, and congressional district levels + date: 2026-02-06 12:00:00 From e00df602420819ec34602a2ba995d92cee693f71 Mon Sep 17 00:00:00 2001 From: Daphne Hansell <128793799+daphnehanse11@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:15:23 -0500 Subject: [PATCH 3/4] Add changelog_entry.yaml for CI check Co-Authored-By: Claude Opus 4.6 --- changelog_entry.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..beaa438c 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,6 @@ +- bump: minor + changes: + added: + - Add ACA Premium Tax Credit (PTC) targets from IRS SOI CD-level data (N85530/A85530) + at national, state, and congressional district levels + date: 2026-02-06 12:00:00 From 5be2ec6c2134ad49e35739bb3d5b62344f3c5225 Mon Sep 17 00:00:00 2001 From: Daphne Hansell <128793799+daphnehanse11@users.noreply.github.com> Date: Fri, 6 Feb 2026 13:41:45 -0500 Subject: [PATCH 4/4] =?UTF-8?q?Revert=20changelog.yaml=20change=20?= =?UTF-8?q?=E2=80=94=20entry=20belongs=20only=20in=20changelog=5Fentry.yam?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- changelog.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 940780df..3fb45a92 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -803,9 +803,3 @@ fixed: - Fix etl_state_income_tax.py API mismatches with db_metadata utility functions date: 2026-02-01 20:58:21 -- bump: minor - changes: - added: - - Add ACA Premium Tax Credit (PTC) targets from IRS SOI CD-level data (N85530/A85530) - at national, state, and congressional district levels - date: 2026-02-06 12:00:00