From 59ce17786de23d7a8d47a0ce3cd8ce6af62b2087 Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Thu, 11 Jul 2024 14:43:16 -0400 Subject: [PATCH] Add SALT tracing --- .../storage/output/tax_expenditures | 6 +++--- tax_microdata_benchmarking/utils/trace.py | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tax_microdata_benchmarking/storage/output/tax_expenditures b/tax_microdata_benchmarking/storage/output/tax_expenditures index 9600a33c..7ec865f4 100644 --- a/tax_microdata_benchmarking/storage/output/tax_expenditures +++ b/tax_microdata_benchmarking/storage/output/tax_expenditures @@ -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 diff --git a/tax_microdata_benchmarking/utils/trace.py b/tax_microdata_benchmarking/utils/trace.py index 194f913c..69a02d01 100644 --- a/tax_microdata_benchmarking/utils/trace.py +++ b/tax_microdata_benchmarking/utils/trace.py @@ -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()