Recipe 2: Estimating Behavioral Response to Reform#
This is an advanced recipe that should be followed only after mastering the basic recipe. This recipe shows how to analyze the behavioral responses to a tax reform using the Behavioral-Responses behresp package.
import sys
if 'google.colab' in sys.modules:
!pip install -q condacolab &> /dev/null # dev/null suppresses output
import condacolab
condacolab.install()
import taxcalc as tc
import behresp
# use publicly-available CPS input file
recs = tc.Records.cps_constructor()
# specify baseline Calculator object representing current-law policy
pol = tc.Policy()
calc1 = tc.Calculator(policy=pol, records=recs)
CYR = 2020
# calculate aggregate current-law income tax liabilities for cyr
calc1.advance_to_year(CYR)
calc1.calc_all()
itax_rev1 = calc1.weighted_total('iitax')
# specify Calculator object for static analysis of reform policy
pol.implement_reform(tc.Policy.read_json_reform('github://PSLmodels:Tax-Calculator@master/docs/recipes/_static/reformA.json'))
calc2 = tc.Calculator(policy=pol, records=recs)
# calculate reform income tax liabilities for cyr under static assumptions
calc2.advance_to_year(CYR)
calc2.calc_all()
itax_rev2sa = calc2.weighted_total('iitax')
# specify assumed non-zero response-function substitution elasticity
response_elasticities = {'sub': 0.25}
# specify Calculator object for analysis of reform with behavioral responses
calc2 = tc.Calculator(policy=pol, records=recs)
calc2.advance_to_year(CYR)
_, df2br = behresp.response(calc1, calc2, response_elasticities)
# calculate reform income tax liabilities for CYR with behavioral response
itax_rev2br = (df2br['iitax'] * df2br['s006']).sum()
# print total income tax revenue estimates for CYR
# (estimates in billons of dollars)
print('{}_CURRENT_LAW_P__itax_rev($B)= {:.3f}'.format(CYR, itax_rev1 * 1e-9))
print('{}_REFORM_STATIC__itax_rev($B)= {:.3f}'.format(CYR, itax_rev2sa * 1e-9))
print('{}_REFORM_DYNAMIC_itax_rev($B)= {:.3f}'.format(CYR, itax_rev2br * 1e-9))
2020_CURRENT_LAW_P__itax_rev($B)= 819.584
2020_REFORM_STATIC__itax_rev($B)= 823.777
2020_REFORM_DYNAMIC_itax_rev($B)= 811.398
Create multi-year diagnostic tables for
baseline,
reform excluding behavioral responses, and
reform including behavioral responses
NUM_YEARS = 3 # number of diagnostic table years beginning with CYR
dtable1 = calc1.diagnostic_table(NUM_YEARS)
dtable2 = calc2.diagnostic_table(NUM_YEARS)
dvar_list3 = list()
year_list3 = list()
for year in range(CYR, CYR + NUM_YEARS):
calc1.advance_to_year(year)
calc2.advance_to_year(year)
_, df2br = behresp.response(calc1, calc2, response_elasticities)
dvar_list3.append(df2br)
year_list3.append(year)
dtable3 = tc.create_diagnostic_table(dvar_list3, year_list3)
Diagnostic table for baseline:
dtable1
| 2020 | 2021 | 2022 | |
|---|---|---|---|
| Returns (#m) | 204.480 | 207.080 | 209.660 |
| AGI ($b) | 11573.238 | 13174.913 | 13526.351 |
| Itemizers (#m) | 27.470 | 31.180 | 31.150 |
| Itemized Deduction ($b) | 745.347 | 862.698 | 881.943 |
| Standard Deduction Filers (#m) | 176.900 | 175.780 | 178.510 |
| Standard Deduction ($b) | 3080.762 | 3091.912 | 3231.348 |
| Personal Exemption ($b) | 0.000 | 0.000 | 0.000 |
| Taxable Income ($b) | 8615.433 | 10049.898 | 10315.188 |
| Regular Tax ($b) | 1497.393 | 1762.841 | 1834.719 |
| AMT Income ($b) | 10965.631 | 12473.801 | 12804.193 |
| AMT Liability ($b) | 0.537 | 1.443 | 0.634 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1497.930 | 1764.284 | 1835.354 |
| Refundable Credits ($b) | 655.022 | 827.135 | 98.486 |
| Nonrefundable Credits ($b) | 99.198 | 0.005 | 107.732 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 82.267 | 87.882 |
| Ind Income Tax ($b) | 819.584 | 1019.410 | 1717.018 |
| Payroll Taxes ($b) | 1154.642 | 1250.313 | 1348.039 |
| Combined Liability ($b) | 1974.226 | 2269.723 | 3065.057 |
| With Income Tax <= 0 (#m) | 133.130 | 126.020 | 94.510 |
| With Combined Tax <= 0 (#m) | 98.170 | 97.730 | 67.880 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4069.559 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4069.559 |
Diagnostic table for reform, excluding behavioral responses:
dtable2
| 2020 | 2021 | 2022 | |
|---|---|---|---|
| Returns (#m) | 204.480 | 207.080 | 209.660 |
| AGI ($b) | 11573.238 | 13174.913 | 13526.351 |
| Itemizers (#m) | 27.390 | 31.060 | 31.020 |
| Itemized Deduction ($b) | 742.833 | 859.361 | 878.367 |
| Standard Deduction Filers (#m) | 176.980 | 175.900 | 178.640 |
| Standard Deduction ($b) | 3082.124 | 3093.960 | 3233.546 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8367.731 | 9785.467 | 10038.749 |
| Regular Tax ($b) | 1499.234 | 1766.802 | 1841.000 |
| AMT Income ($b) | 10969.682 | 12478.576 | 12809.293 |
| AMT Liability ($b) | 0.544 | 1.473 | 0.633 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1499.778 | 1768.275 | 1841.634 |
| Refundable Credits ($b) | 658.339 | 827.135 | 102.191 |
| Nonrefundable Credits ($b) | 93.536 | 0.002 | 102.059 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 82.267 | 87.882 |
| Ind Income Tax ($b) | 823.777 | 1023.405 | 1725.266 |
| Payroll Taxes ($b) | 1154.642 | 1250.313 | 1348.039 |
| Combined Liability ($b) | 1978.419 | 2273.717 | 3073.305 |
| With Income Tax <= 0 (#m) | 135.240 | 128.230 | 96.990 |
| With Combined Tax <= 0 (#m) | 98.930 | 98.610 | 68.610 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4069.559 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4069.559 |
Diagnostic table for reform, including behavioral responses:
dtable3
| 2020 | 2021 | 2022 | |
|---|---|---|---|
| Returns (#m) | 204.480 | 207.080 | 209.660 |
| AGI ($b) | 11546.617 | 13141.583 | 13491.061 |
| Itemizers (#m) | 27.360 | 31.030 | 31.000 |
| Itemized Deduction ($b) | 741.563 | 857.621 | 876.792 |
| Standard Deduction Filers (#m) | 177.010 | 175.930 | 178.660 |
| Standard Deduction ($b) | 3082.683 | 3094.695 | 3234.045 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8341.362 | 9752.504 | 10004.156 |
| Regular Tax ($b) | 1487.278 | 1752.439 | 1825.764 |
| AMT Income ($b) | 10943.680 | 12446.211 | 12775.076 |
| AMT Liability ($b) | 0.543 | 1.471 | 0.630 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1487.822 | 1753.911 | 1826.394 |
| Refundable Credits ($b) | 658.049 | 827.121 | 101.922 |
| Nonrefundable Credits ($b) | 93.768 | 0.002 | 102.309 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.394 | 81.712 | 87.313 |
| Ind Income Tax ($b) | 811.398 | 1008.499 | 1709.476 |
| Payroll Taxes ($b) | 1154.162 | 1249.473 | 1347.161 |
| Combined Liability ($b) | 1965.560 | 2257.972 | 3056.637 |
| With Income Tax <= 0 (#m) | 135.210 | 128.200 | 96.830 |
| With Combined Tax <= 0 (#m) | 98.910 | 98.580 | 68.420 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4069.559 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4069.559 |