Skip to content

Commit

Permalink
Merge pull request #296 from andersonfrailey/removefiler
Browse files Browse the repository at this point in the history
Replace filer variable with data_source
  • Loading branch information
andersonfrailey authored Jan 10, 2019
2 parents cb0c6cd + 4b06823 commit 9bbe5d0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
Binary file modified cps_data/cps.csv.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion cps_data/finalprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def drop_vars(data):
'e07400', 'e07600', 'e09700', 'e09800', 'e09900', 'e11200', 'e17500',
'e18400', 'e18500', 'e19200', 'e19800', 'e20100', 'e20400', 'g20500',
'e24515', 'e24518', 'e26270', 'e27200', 'e32800', 'e58990', 'e62900',
'e87530', 'elderly_dependents', 'f2441', 'f6251', 'filer', 'n24',
'e87530', 'elderly_dependents', 'f2441', 'f6251', 'n24',
'nu05', 'nu13', 'nu18', 'n1820', 'n21', 'p08000', 'p22250', 'p23250',
'p25470', 'p87521', 's006', 'e03210', 'ssi_ben', 'snap_ben',
'vet_ben', 'mcare_ben', 'mcaid_ben', 'oasdi_ben', 'other_ben',
Expand Down
2 changes: 2 additions & 0 deletions puf_data/finalprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def main():
# - Impute pension contributions:
data = impute_pension_contributions(data.copy())

# Rename 'filer' to 'data_source'
data = data.rename(columns={'filer': 'data_source'})
# - Write processed data to the final CSV-formatted file:
if BENPUF:
data.to_csv('benpuf.csv', index=False)
Expand Down
1 change: 0 additions & 1 deletion tests/cps_agg_expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ e32800 28913668 0 1666
elderly_dependents 1724 0 3
f2441 163487 0 10
ffpos 498582 1 11
filer 437439 0 1
fips 12469516 1 56
h_seq 22850538907 1 99461
housing_ben 60379435 0 53253
Expand Down
2 changes: 1 addition & 1 deletion tests/puf_agg_expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ age_head 11691928 1 85
age_spouse 6247637 0 97
agi_bin 1890431 0 18
cmbtp 4316456617 -23842830 83355100
data_source 241245 0 1
e00200 39430402348 0 56530000
e00200p 23634568315 0 28265000
e00200s 15795834033 0 28265000
Expand Down Expand Up @@ -71,7 +72,6 @@ e87530 22144920 0 147200
elderly_dependents 1236 0 3
f2441 16109 0 3
f6251 55220 0 1
filer 241245 0 1
fips 6743572 1 56
g20500 16670714 0 720000
k1bx14p -2197846801 -18990000 2341800
Expand Down
6 changes: 3 additions & 3 deletions tests/records_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,13 @@
"max": 11
}
},
"filer": {
"data_source": {
"type": "int",
"desc": "1 if unit files an income tax return; 0 if not (not used in tax-calculation logic)",
"desc": "1 if unit is created primarily from IRS-SOI PUF data; 0 if created primarily from CPS data (not used in tax-calculation logic)",
"form": {
"2013-2016": "sample construction info"
},
"availability": "taxdata_puf, taxdata_cps",
"availability": "taxdata_puf",
"range": {
"min": 0,
"max": 1
Expand Down

0 comments on commit 9bbe5d0

Please sign in to comment.