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

Basic modifications needed to read CPS input data #1484

Merged
merged 15 commits into from
Jul 20, 2017
Merged

Basic modifications needed to read CPS input data #1484

merged 15 commits into from
Jul 20, 2017

Conversation

martinholmer
Copy link
Collaborator

@martinholmer martinholmer commented Jul 18, 2017

This pull request makes some basic changes to Tax-Calculator that are required in order to read and use CPS input data.

This pull request was developed using two CPS files generated in the taxdata repository after pull request 110 by @andersonfrailey was merged into the master branch: cps.csv.gz and cps_weights.csv.gz.

Using the code on this branch and the new CPS input files, a locally-generated conda taxcalc package, which includes the two CPS input files, produces the following aggregate tax results for current-law policy in 2020:

$ tc puf.csv 2020 --tables
You loaded data for 2009.
Tax-Calculator startup automatically extrapolated your data to 2020.

$ tc cps.csv 2020 --tables
You loaded data for 2014.
Tax-Calculator startup automatically extrapolated your data to 2020.

$ ls -l ???-20*text
-rw-r--r--  1 mrh  staff  1710 Jul 20 15:31 cps-20-#-#-tab.text
-rw-r--r--  1 mrh  staff  1710 Jul 20 15:31 puf-20-#-#-tab.text

$ head -14 puf-20-#-#-tab.text
Weighted Tax Totals by Expanded-Income Decile
    Returns    ExpInc    IncTax    PayTax     LSTax    AllTax
       (#m)      ($b)      ($b)      ($b)      ($b)      ($b)
 0     17.8    -122.6      -2.9       7.3       0.0       4.4
 1     17.8     174.8     -13.7      16.0       0.0       2.4
 2     17.8     312.2     -26.8      27.1       0.0       0.3
 3     17.8     453.9     -17.6      39.5       0.0      21.9
 4     17.8     632.2       1.0      58.1       0.0      59.1
 5     17.8     851.7      31.5      79.1       0.0     110.7
 6     17.8    1136.9      70.0     106.5       0.0     176.6
 7     17.8    1551.7     133.4     158.2       0.0     291.6
 8     17.8    2310.8     245.1     260.6       0.0     505.7
 9     17.8    6912.4    1463.6     471.3       0.0    1934.9
 A    177.7   14214.0    1883.8    1223.7       0.0    3107.5

$ head -14 cps-20-#-#-tab.text
Weighted Tax Totals by Expanded-Income Decile
    Returns    ExpInc    IncTax    PayTax     LSTax    AllTax
       (#m)      ($b)      ($b)      ($b)      ($b)      ($b)
 0     17.5      -3.5      -1.9       3.3       0.0       1.4
 1     17.5     184.9     -14.0      12.5       0.0      -1.5
 2     17.5     322.4     -16.4      22.9       0.0       6.5
 3     17.5     469.2     -12.7      43.1       0.0      30.4
 4     17.5     636.2       4.2      66.2       0.0      70.3
 5     17.5     848.3      30.4      95.1       0.0     125.5
 6     17.5    1139.6      69.3     135.5       0.0     204.8
 7     17.5    1576.5     130.1     197.3       0.0     327.4
 8     17.5    2284.8     231.3     291.3       0.0     522.6
 9     17.5    5435.9    1022.0     473.8       0.0    1495.8
 A    174.5   12894.2    1442.3    1341.0       0.0    2783.3

The CPS input data produces more payroll taxes, but less income taxes, than the PUF input data.

@MattHJensen @feenberg @Amy-Xu @andersonfrailey @hdoupe

@codecov-io
Copy link

codecov-io commented Jul 18, 2017

Codecov Report

Merging #1484 into master will increase coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1484      +/-   ##
==========================================
+ Coverage   99.71%   99.96%   +0.25%     
==========================================
  Files          40       40              
  Lines        2795     2806      +11     
==========================================
+ Hits         2787     2805      +18     
+ Misses          8        1       -7
Impacted Files Coverage Δ
taxcalc/parameters.py 99.57% <ø> (+0.42%) ⬆️
taxcalc/growfactors.py 100% <100%> (+1.33%) ⬆️
taxcalc/calculate.py 100% <100%> (ø) ⬆️
taxcalc/records.py 100% <100%> (+1.19%) ⬆️
taxcalc/taxcalcio.py 100% <100%> (ø) ⬆️
taxcalc/utils.py 100% <100%> (+0.38%) ⬆️

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 70e488c...6d38e6d. Read the comment docs.

@martinholmer
Copy link
Collaborator Author

Tax-Calculator pull request #1484 is now complete and waiting for the cps.csv and cps_weights.csv files from the taxdata repository that will be included in this pull request. Per @MattHJensen instructions, this pull request will include CPS input files that exclude the C-TAM benefit variables. Those benefit variables will be added in subsequent taxdata and Tax-Calculator pull requests.

@MattHJensen @Amy-Xu @andersonfrailey @hdoupe

@martinholmer martinholmer changed the title [WIP] Basic modifications need to read CPS input data [WIP] Basic modifications needed to read CPS input data Jul 19, 2017
@martinholmer martinholmer changed the title [WIP] Basic modifications needed to read CPS input data Basic modifications needed to read CPS input data Jul 20, 2017
@martinholmer
Copy link
Collaborator Author

Merging Tax-Calculator pull request #1484 that includes the new cps.csv.gz and cps_weights.csv.gz files generated in the taxdata repository.

@martinholmer martinholmer merged commit 57883d3 into PSLmodels:master Jul 20, 2017
@martinholmer martinholmer deleted the cps-read branch July 20, 2017 19:59
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