Add tax_unit_itemizes constraint for itemized deduction targets#639
Open
Add tax_unit_itemizes constraint for itemized deduction targets#639
Conversation
SOI targets for SALT, real estate taxes, and medical expense deduction are reported only for the ~10% of filers who itemize, but the existing `variable > 0` constraint captures everyone with economic exposure (~80-90% of filers). This mismatch causes massive count and dollar overestimates. Adding `tax_unit_itemizes == 1` fixes the population alignment. Changes: - etl_irs_soi.py: For salt, real_estate_taxes, and medical_expense_deduction, append a `tax_unit_itemizes == 1` constraint to child strata in the generic target loop. - etl_national_targets.py: Split JCT itemized deduction targets (salt_deduction, medical_expense_deduction, charitable_deduction, interest_deduction) into a separate itemizer_targets list loaded into a new "United States - Itemizing Tax Filers" stratum with both filer and itemizer constraints. QBI deduction remains in the plain filer stratum (above-the-line). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
etl_irs_soi.py): Forsalt,real_estate_taxes, andmedical_expense_deduction, append atax_unit_itemizes == 1stratum constraint alongside the existingvariable > 0constraint. SOI only reports these for the ~10% who itemize, but> 0alone captures ~80-90% of filers with any economic exposure, causing massive overestimates (e.g. 11.3x SALT blowup).etl_national_targets.py): Movesalt_deduction,medical_expense_deduction,charitable_deduction, andinterest_deductioninto a new "United States - Itemizing Tax Filers" stratum with bothtax_unit_is_filer == 1andtax_unit_itemizes == 1constraints.qualified_business_income_deductionstays in the plain filer stratum (above-the-line, not Schedule A).Test plan
etl_irs_soi.pyand verify new strata havetax_unit_itemizes == 1constraint for salt, real_estate_taxes, medical_expense_deductionetl_national_targets.pyand verify "United States - Itemizing Tax Filers" stratum is created with correct constraintstax_unit_itemizesconstraint)🤖 Generated with Claude Code