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.585
2020_REFORM_STATIC__itax_rev($B)= 823.778
2020_REFORM_DYNAMIC_itax_rev($B)= 811.399
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.240 | 13243.119 | 13525.084 |
| Itemizers (#m) | 27.470 | 31.480 | 31.370 |
| Itemized Deduction ($b) | 745.341 | 872.203 | 888.655 |
| Standard Deduction Filers (#m) | 176.900 | 175.480 | 178.300 |
| Standard Deduction ($b) | 3080.762 | 3085.817 | 3226.803 |
| Personal Exemption ($b) | 0.000 | 0.000 | 0.000 |
| Taxable Income ($b) | 8615.438 | 10113.453 | 10313.859 |
| Regular Tax ($b) | 1497.393 | 1776.855 | 1834.886 |
| AMT Income ($b) | 10965.638 | 12534.898 | 12799.760 |
| AMT Liability ($b) | 0.537 | 1.451 | 0.635 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1497.931 | 1778.306 | 1835.521 |
| Refundable Credits ($b) | 655.022 | 826.380 | 99.096 |
| Nonrefundable Credits ($b) | 99.198 | 0.005 | 107.424 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 83.585 | 87.423 |
| Ind Income Tax ($b) | 819.585 | 1035.506 | 1716.423 |
| Payroll Taxes ($b) | 1154.642 | 1252.707 | 1343.466 |
| Combined Liability ($b) | 1974.227 | 2288.212 | 3059.889 |
| With Income Tax <= 0 (#m) | 133.130 | 125.860 | 94.700 |
| With Combined Tax <= 0 (#m) | 98.170 | 97.580 | 67.970 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4070.218 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4070.218 |
Diagnostic table for reform, excluding behavioral responses:
dtable2
| 2020 | 2021 | 2022 | |
|---|---|---|---|
| Returns (#m) | 204.480 | 207.080 | 209.660 |
| AGI ($b) | 11573.240 | 13243.119 | 13525.084 |
| Itemizers (#m) | 27.390 | 31.360 | 31.250 |
| Itemized Deduction ($b) | 742.827 | 868.841 | 885.568 |
| Standard Deduction Filers (#m) | 176.980 | 175.600 | 178.410 |
| Standard Deduction ($b) | 3082.124 | 3087.838 | 3228.760 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8367.736 | 9848.768 | 10037.632 |
| Regular Tax ($b) | 1499.235 | 1781.411 | 1841.508 |
| AMT Income ($b) | 10969.689 | 12539.710 | 12804.390 |
| AMT Liability ($b) | 0.544 | 1.479 | 0.634 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1499.779 | 1782.891 | 1842.142 |
| Refundable Credits ($b) | 658.339 | 826.380 | 102.806 |
| Nonrefundable Credits ($b) | 93.536 | 0.002 | 101.737 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 83.585 | 87.423 |
| Ind Income Tax ($b) | 823.778 | 1040.093 | 1725.022 |
| Payroll Taxes ($b) | 1154.642 | 1252.707 | 1343.466 |
| Combined Liability ($b) | 1978.420 | 2292.800 | 3068.488 |
| With Income Tax <= 0 (#m) | 135.240 | 128.020 | 97.180 |
| With Combined Tax <= 0 (#m) | 98.930 | 98.460 | 68.660 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4070.218 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4070.218 |
Diagnostic table for reform, including behavioral responses:
dtable3
| 2020 | 2021 | 2022 | |
|---|---|---|---|
| Returns (#m) | 204.480 | 207.080 | 209.660 |
| AGI ($b) | 11546.619 | 13209.241 | 13489.513 |
| Itemizers (#m) | 27.360 | 31.330 | 31.230 |
| Itemized Deduction ($b) | 741.558 | 867.138 | 884.107 |
| Standard Deduction Filers (#m) | 177.010 | 175.630 | 178.430 |
| Standard Deduction ($b) | 3082.683 | 3088.512 | 3229.115 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8341.367 | 9815.413 | 10002.653 |
| Regular Tax ($b) | 1487.279 | 1766.892 | 1826.126 |
| AMT Income ($b) | 10943.687 | 12506.912 | 12769.684 |
| AMT Liability ($b) | 0.543 | 1.478 | 0.629 |
| AMT Filers (#m) | 0.070 | 0.190 | 0.080 |
| Tax before Credits ($b) | 1487.822 | 1768.369 | 1826.755 |
| Refundable Credits ($b) | 658.049 | 826.375 | 102.537 |
| Nonrefundable Credits ($b) | 93.768 | 0.002 | 101.986 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.394 | 83.011 | 86.832 |
| Ind Income Tax ($b) | 811.399 | 1025.003 | 1709.063 |
| Payroll Taxes ($b) | 1154.162 | 1251.845 | 1342.612 |
| Combined Liability ($b) | 1965.561 | 2276.848 | 3051.675 |
| With Income Tax <= 0 (#m) | 135.210 | 127.990 | 97.050 |
| With Combined Tax <= 0 (#m) | 98.910 | 98.440 | 68.470 |
| UBI Benefits ($b) | 0.000 | 0.000 | 0.000 |
| Total Benefits, Consumption Value ($b) | 3617.042 | 3992.973 | 4070.218 |
| Total Benefits Cost ($b) | 3617.042 | 3992.973 | 4070.218 |