Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Calculator.pch_graph method and associated utility functions #1890

Merged
merged 15 commits into from
Mar 2, 2018
Merged

Add Calculator.pch_graph method and associated utility functions #1890

merged 15 commits into from
Mar 2, 2018

Conversation

martinholmer
Copy link
Collaborator

@martinholmer martinholmer commented Feb 18, 2018

This pull request adds a new graph method to the Calculator class. The new pch_graph method generates a graph in which the percentage change in after-tax expanded income (cause by a policy reform) is plotted for each baseline expanded-income percentile except for percentiles that contain filing units with negative or zero baseline expanded income. This graph, therefore, avoids any distortions caused by some filing units having negative or zero baseline expanded income. These filing units are in the bottom several percentiles, but those percentiles are not shown in the graph.

This pull request resolves the issue discussed in #1888 by using this graph in the tc --graphs output (instead of the decile or quintile graphs that include filing units with negative income) and by making several documentation changes that clarify whether a table or graph includes filing units with negative income.

Here is an example of what the new graph looks like. The following graph is generated using puf.csv data and the reform from the basic recipe in the Cookbook of Tested Recipes for Python Programming with Tax-Calculator:

// Raise personal exemption and raise regular tax rates in top three brackets
// from (0.32, 0.35, 0.37) to (0.36, 0.39, 0.41) beginning in 2020.
{
    "policy": {
	// raise personal exemption amount and index in subsequent years
	"_II_em": {"2020": [1000]},
	// raise tax rates in the top three brackets
	// ... raise non-AMT rates on non-pass-through income
	"_II_rt5": {"2020": [0.36]},
	"_II_rt6": {"2020": [0.39]},
	"_II_rt7": {"2020": [0.41]},
	// ... raise non-AMT rates on pass-through income
	"_PT_rt5": {"2020": [0.36]},
	"_PT_rt6": {"2020": [0.39]},
	"_PT_rt7": {"2020": [0.41]}
    }
}

Here is the new graph for this example:

pch

@codecov-io
Copy link

codecov-io commented Feb 18, 2018

Codecov Report

Merging #1890 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1890   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          37      37           
  Lines        3301    3362   +61     
======================================
+ Hits         3301    3362   +61
Impacted Files Coverage Δ
taxcalc/calculate.py 100% <100%> (ø) ⬆️
taxcalc/utils.py 100% <100%> (ø) ⬆️
taxcalc/taxcalcio.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2ca678...5924ac9. Read the comment docs.

@martinholmer martinholmer added ready and removed WIP labels Feb 18, 2018
@martinholmer
Copy link
Collaborator Author

Given the extensive discussion in issue #1888, it would seem that the graph in pull request #1890 is consistent with a range of future changes in the handling of filing units with non-positive expanded_income in the construction of tables and graphs. Given that, I plan to merge pull request #1890 at the end of the week on Friday, March 2nd.

@martinholmer martinholmer merged commit c9a30df into PSLmodels:master Mar 2, 2018
@martinholmer martinholmer deleted the pchange-graph branch March 7, 2018 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants