Skip to content

Commit

Permalink
update pycps docstring. update wage groups, add 2015 targets for pens…
Browse files Browse the repository at this point in the history
…ion contribution imputations.
  • Loading branch information
andersonfrailey committed Sep 17, 2023
1 parent 9f18ca6 commit 6325337
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docs/book/content/data/puf_file_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ Coming soon...

## Final Prep

Coming soon...
### Imputing Pension Contributions

Target data source: [IRS SOI W-2 statistics](https://www.irs.gov/statistics/soi-tax-stats-individual-information-return-form-w2-statistics)
6 changes: 4 additions & 2 deletions taxdata/cps/pycps.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,15 @@ def pycps(cps: list, year: int, ctam_benefits: bool, verbose: bool) -> pd.DataFr
Parameters
----------
cps: List where each element is a household in the CPS
year: CPS year to use
ctam_benefits: If true, attach C-TAM benefits to the CPS
verbose
"""
tax_units = []
ctam_benefits = True
if year not in C_TAM_YEARS and ctam_benefits:
raise ValueError(f'C-TAM Benefits not available for year {year}')
for hh in tqdm(cps):
tax_units += create_units(hh, year - 1, ctam_benefits=ctam_benefits)
tax_units += create_units(hh, year - 1, ctam_benefits=ctam_benefits, verbose=verbose)
# create a DataFrame of tax units with the new
tax_units_df = pd.DataFrame(tax_units)

Expand Down
11 changes: 3 additions & 8 deletions taxdata/puf/impute_pencon.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@
for details.
"""
from __future__ import print_function
import sys
import numpy as np
import pandas as pd
from pathlib import Path

if sys.version_info[0] < 3:
from StringIO import StringIO
else:
from io import StringIO


CURPATH = Path(__file__).resolve().parent
DUMP0 = False
Expand Down Expand Up @@ -96,7 +90,7 @@ def targets(year):
1e6,
2e6,
5e6,
30e6,
124e6,
]


Expand Down Expand Up @@ -156,7 +150,8 @@ def wage_group(row):
# several times each with a different value of HIWAGE_PROB_SF.


# specify maximum legal elective deferral amount for DC pensions in 2011
# specify maximum legal elective deferral amount for DC pensions in each year
# the PUF is supported
MAX_PENCON_AMT = {2011: 16500, 2015: 1800}


Expand Down

0 comments on commit 6325337

Please sign in to comment.