Skip to content

Commit

Permalink
group recipe05 diff table by standard income bins
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-Metz committed Aug 19, 2020
1 parent aafe5c4 commit 6d20ebd
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions docs/recipes/recipe05.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,27 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2018_REFORM1_iitax_rev($B)= 1422.968\n",
"2018_REFORM2_iitax_rev($B)= 1272.649\n",
"2018_REFORM1_iitax_rev($B)= 1490.621\n",
"2018_REFORM2_iitax_rev($B)= 1318.628\n",
"\n",
"Extract of 2018 income-tax difference table by expanded-income decile\n",
"(taxfall is count of funits with cut in income tax in reform 2 vs 1)\n",
"(taxrise is count of funits with rise in income tax in reform 2 vs 1)\n",
" funits(#m) taxfall(#m) taxrise(#m) agg_diff($b) mean_diff($) aftertax_income_diff(%)\n",
"0-10n 0.07 0.00 0.00 0.006 94.0 0.0\n",
"0-10z 15.87 0.00 0.01 -0.000 -0.0 -10.1\n",
"0-10p 0.34 0.00 0.00 0.000 0.0 0.0\n",
"10-20 16.29 1.08 0.68 -0.075 -4.6 0.1\n",
"20-30 16.29 9.95 2.66 -1.531 -94.0 0.6\n",
"30-40 16.29 12.77 2.12 -3.741 -229.7 1.0\n",
"40-50 16.29 13.55 2.17 -7.217 -443.1 1.5\n",
"50-60 16.29 13.78 2.22 -10.153 -623.4 1.6\n",
"60-70 16.28 13.64 2.45 -12.430 -763.3 1.5\n",
"70-80 16.29 14.00 2.13 -16.511 -1013.7 1.5\n",
"80-90 16.29 13.84 2.35 -23.084 -1417.4 1.4\n",
"90-100 16.29 14.54 1.71 -75.584 -4640.8 2.1\n",
"ALL 162.86 107.16 18.49 -150.319 -923.0 1.7\n",
"90-95 8.14 7.15 0.96 -18.297 -2246.9 1.6\n",
"95-99 6.51 5.97 0.54 -34.982 -5369.6 2.5\n",
"Top 1% 1.63 1.42 0.20 -22.305 -13695.2 2.1\n"
" funits(#m) taxfall(#m) taxrise(#m) agg_diff($b) mean_diff($) aftertax_income_diff(%)\n",
"<$0K 0.139124 0 0 0 0 0\n",
"=$0K 29.361 0.00398284 0.00256599 -0.000287359 -0.00978711 -10.9947\n",
"$0-10K 32.6342 2.4395 1.48106 -0.192404 -5.89577 0.153202\n",
"$10-20K 21.2155 11.4005 3.74961 -1.57495 -74.2359 0.523949\n",
"$20-30K 18.4881 13.4157 3.11783 -3.83301 -207.323 0.911481\n",
"$30-40K 16.8463 13.3099 2.78059 -7.11432 -422.308 1.39848\n",
"$40-50K 13.3335 11.0923 1.91614 -8.32639 -624.471 1.66377\n",
"$50-75K 22.9225 20.2617 2.36473 -20.2522 -883.508 1.78165\n",
"$75-100K 13.7307 12.3925 1.2298 -16.2928 -1186.6 1.73044\n",
"$100-200K 21.7543 19.7221 1.93615 -41.9197 -1926.96 1.8326\n",
"$200-500K 7.84776 7.23654 0.604507 -43.9066 -5594.79 2.66207\n",
"$500-1000K 1.14915 1.07263 0.0765177 -15.3413 -13350.1 2.85443\n",
">$1000K 0.514758 0.428676 0.0860823 -13.2397 -25720.2 1.98472\n",
"ALL 199.937 112.776 19.3456 -171.994 -860.24 1.89689\n"
]
}
],
Expand Down Expand Up @@ -200,7 +198,7 @@
"iitax_rev2 = calc2.weighted_total('iitax')\n",
"\n",
"# construct reform-vs-baseline difference table with results for income deciles\n",
"diff_table = calc1.difference_table(calc2, 'weighted_deciles', 'iitax')\n",
"diff_table = calc1.difference_table(calc2, 'standard_income_bins', 'iitax')\n",
"assert isinstance(diff_table, pd.DataFrame)\n",
"diff_extract = pd.DataFrame()\n",
"dif_colnames = ['count', 'tax_cut', 'tax_inc',\n",
Expand Down Expand Up @@ -246,7 +244,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.6.7"
},
"title": "Recipe 5: Redefining Expanded Income"
},
Expand Down

0 comments on commit 6d20ebd

Please sign in to comment.