Skip to content

Commit

Permalink
Merge pull request #138 from PSLmodels/salt-tracing
Browse files Browse the repository at this point in the history
Add SALT itemized deduction tracing
  • Loading branch information
martinholmer authored Jul 11, 2024
2 parents 9a58034 + 59ce177 commit 8eed273
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tax_microdata_benchmarking/storage/output/tax_expenditures
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
YEAR,KIND,ESTIMATE= 2023 iitax 2306.3
YEAR,KIND,ESTIMATE= 2023 iitax 2306.4
YEAR,KIND,ESTIMATE= 2023 ctc 96.6
YEAR,KIND,ESTIMATE= 2023 eitc 77.4
YEAR,KIND,ESTIMATE= 2023 social_security_partial_taxability 53.3
YEAR,KIND,ESTIMATE= 2023 social_security_partial_taxability 53.2
YEAR,KIND,ESTIMATE= 2023 niit -56.7
YEAR,KIND,ESTIMATE= 2023 cgqd_tax_preference 223.2
YEAR,KIND,ESTIMATE= 2023 qbid 56.5
YEAR,KIND,ESTIMATE= 2023 qbid 56.4
YEAR,KIND,ESTIMATE= 2023 salt 11.4
10 changes: 7 additions & 3 deletions tax_microdata_benchmarking/utils/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ def trace1(loc: str, vdf: pd.DataFrame) -> None:
# CTC tabulations
if "ctc_total" in vdf:
ctc = vdf.ctc_total * filer
ctc_wtot = (wght * ctc).sum() * 1e-9
ctc_amt = (wght * ctc).sum() * 1e-9
ctc_num = (wght * (ctc > 0)).sum() * 1e-6
print(f">{loc} weighted puf CTC ($B)= {ctc_wtot:.3f} [124.6]")
print(f">{loc} weighted puf CTC ($B)= {ctc_amt:.3f} [124.6]")
print(f">{loc} weighted puf CTC (#M)= {ctc_num:.3f} [36.5...47.4]")
else:
print(f">{loc} CTC not in DataFrame")
# SALT tabulations
# TODO: add code here
salt = (vdf.e18400 + vdf.e18500) * filer
salt_amt = (wght * salt).sum() * 1e-9
salt_num = (wght * (salt > 0)).sum() * 1e-6
print(f">{loc} weighted puf SALT ($B)= {salt_amt:.3f} [?]")
print(f">{loc} weighted puf SALT (#M)= {salt_num:.3f} [14.3...27.1]")
# PT_binc_w2_wages tabulations
w2wages = vdf.PT_binc_w2_wages * filer
wages_min = w2wages.min()
Expand Down

0 comments on commit 8eed273

Please sign in to comment.