Index of /to-taxsim/cps27/cps-uchicago

### Summary of TAXSIM-CPS code, prepared for Dan Feenberg ###
Last edited: 01/07/2021

Purpose: Prepares public-use CPS data for input into TAXSIM (creation of tax units out of CPS variables, creation of TAXSIM inputs, and running TAXSIM)
Input: cps2011.dta (Public-use CPS ASEC for 2011 from NBER) - can be downloaded from https://data.nber.org/data/current-population-survey-data.html 
Main output: cps_taxsim_family_improving_tsim.dta (CPS individual level file with output of TAXSIM merged in)

Summary of code (w/ subsections):

-Preparing public-use CPS file for calculation of TAXSIM inputs (Lines 23-177):
-- Lines 23-40 generate family and sub-family IDs and delete observations that are not needed (i.e. missing person identifiers within families)
-- Lines 42-72 identify tax units and generates a new variable indicating filing status.
-- Lines 74-140 identify dependents and those who qualify as EITC/CTC eligible children. 
-- Lines 143-177 calculate the number of dependents, generates a person_id variable (identifying head of tax unit, non-filer, member of tax unit), and saves a file of both tax unit IDs and the full data. 


-Creation of TAXSIM inputs (Lines 185-435):
-- Line 185 (ish) generates tu_identifier variable, which identifies heads of tax units. 
-- Lines 190-271 generate household characteristics for input into TAXSIM.
-- Lines 275-411 generate income inputs into TAXSIM.
-- Lines 415-435 create the dataset that will be input into TAXSIM (primarily collapses to tax unit level)


-Running variables through TAXSIM and cleaning output (Lines 439-489. Note: Much of this section is commented out, as some cleaning is done that is unique to our version of TAXSIM at Census
and does not apply to the public version of TAXSIM):
-- Lines 455-486 are commented out. These are the lines that clean the TAXSIM outputs due to odd output unique to our version of TAXSIM at Census. 


-Creating full dataset, combining TAXSIM inputs with outputs, and  (Lines 492-562):