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)= 773.000
2020_REFORM_STATIC__itax_rev($B)= 777.193
2020_REFORM_DYNAMIC_itax_rev($B)= 764.913
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) | 11572.622 | 13242.423 | 13524.306 |
| Itemizers (#m) | 27.450 | 31.430 | 31.350 |
| Itemized Deduction ($b) | 745.193 | 871.548 | 888.465 |
| Standard Deduction Filers (#m) | 176.920 | 175.530 | 178.310 |
| Standard Deduction ($b) | 3081.007 | 3086.718 | 3227.131 |
| Personal Exemption ($b) | 0.000 | 0.000 | 0.000 |
| Taxable Income ($b) | 8615.647 | 10113.501 | 10314.027 |
| Regular Tax ($b) | 1497.472 | 1776.902 | 1834.966 |
| AMT Income ($b) | 7876.981 | 9440.105 | 9563.756 |
| AMT Liability ($b) | 0.493 | 1.282 | 0.574 |
| AMT Filers (#m) | 0.060 | 0.150 | 0.070 |
| Tax before Credits ($b) | 1497.966 | 1778.185 | 1835.541 |
| Refundable Credits ($b) | 638.340 | 809.248 | 82.664 |
| Nonrefundable Credits ($b) | 99.200 | 0.005 | 107.426 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 83.585 | 87.423 |
| Ind Income Tax ($b) | 773.000 | 983.855 | 1661.082 |
| Payroll Taxes ($b) | 1217.941 | 1321.368 | 1415.259 |
| Combined Liability ($b) | 1990.941 | 2305.223 | 3076.340 |
| With Income Tax <= 0 (#m) | 135.440 | 127.600 | 95.560 |
| With Combined Tax <= 0 (#m) | 97.130 | 96.400 | 65.180 |
| 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) | 11572.622 | 13242.423 | 13524.306 |
| Itemizers (#m) | 27.370 | 31.310 | 31.230 |
| Itemized Deduction ($b) | 742.660 | 868.177 | 885.377 |
| Standard Deduction Filers (#m) | 177.000 | 175.640 | 178.430 |
| Standard Deduction ($b) | 3082.379 | 3088.755 | 3229.092 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8367.955 | 9848.811 | 10037.794 |
| Regular Tax ($b) | 1499.314 | 1781.460 | 1841.590 |
| AMT Income ($b) | 7879.688 | 9442.905 | 9566.446 |
| AMT Liability ($b) | 0.499 | 1.309 | 0.572 |
| AMT Filers (#m) | 0.060 | 0.160 | 0.070 |
| Tax before Credits ($b) | 1499.813 | 1782.769 | 1842.162 |
| Refundable Credits ($b) | 641.657 | 809.248 | 86.370 |
| Nonrefundable Credits ($b) | 93.538 | 0.002 | 101.739 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.874 | 83.585 | 87.423 |
| Ind Income Tax ($b) | 777.193 | 988.442 | 1669.683 |
| Payroll Taxes ($b) | 1217.941 | 1321.368 | 1415.259 |
| Combined Liability ($b) | 1995.134 | 2309.810 | 3084.942 |
| With Income Tax <= 0 (#m) | 137.600 | 129.840 | 98.410 |
| With Combined Tax <= 0 (#m) | 97.870 | 97.290 | 65.750 |
| 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) | 11545.758 | 13208.537 | 13488.456 |
| Itemizers (#m) | 27.340 | 31.280 | 31.220 |
| Itemized Deduction ($b) | 741.378 | 866.467 | 883.914 |
| Standard Deduction Filers (#m) | 177.020 | 175.680 | 178.450 |
| Standard Deduction ($b) | 3082.937 | 3089.448 | 3229.447 |
| Personal Exemption ($b) | 375.177 | 384.158 | 406.780 |
| Taxable Income ($b) | 8341.337 | 9815.453 | 10002.555 |
| Regular Tax ($b) | 1487.315 | 1766.945 | 1826.162 |
| AMT Income ($b) | 7852.867 | 9409.417 | 9531.110 |
| AMT Liability ($b) | 0.499 | 1.313 | 0.570 |
| AMT Filers (#m) | 0.060 | 0.160 | 0.070 |
| Tax before Credits ($b) | 1487.814 | 1768.258 | 1826.731 |
| Refundable Credits ($b) | 641.420 | 809.270 | 86.175 |
| Nonrefundable Credits ($b) | 93.755 | 0.002 | 101.972 |
| Reform Surtaxes ($b) | 0.000 | 0.000 | 0.000 |
| Other Taxes ($b) | 75.395 | 83.010 | 86.825 |
| Ind Income Tax ($b) | 764.913 | 973.539 | 1653.849 |
| Payroll Taxes ($b) | 1217.257 | 1320.298 | 1414.153 |
| Combined Liability ($b) | 1982.170 | 2293.837 | 3068.002 |
| With Income Tax <= 0 (#m) | 137.560 | 129.810 | 98.270 |
| With Combined Tax <= 0 (#m) | 97.850 | 97.260 | 65.600 |
| 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 |