|
|
clear all
|
|
|
set more off
|
|
|
set maxvar 10000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local procdata "./proc_data"
|
|
|
|
|
|
|
|
|
|
|
|
local cpi1999 = 163.01
|
|
|
local cpi2001 = 172.19
|
|
|
local cpi2003 = 179.87
|
|
|
local cpi2005 = 188.91
|
|
|
local cpi2007 = 201.56
|
|
|
local cpi2009 = 215.25
|
|
|
local cpi2011 = 218.09
|
|
|
|
|
|
|
|
|
forval x=1999(2)2011{
|
|
|
di "YEAR `x'"
|
|
|
|
|
|
cd raw_data
|
|
|
|
|
|
|
|
|
do FAM`x'ER.do
|
|
|
|
|
|
|
|
|
do save_data_`x'.do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g year = year_survey - 1
|
|
|
|
|
|
|
|
|
g state = 0
|
|
|
replace state = 1 if state_residence == 01
|
|
|
replace state = 2 if state_residence == 50
|
|
|
replace state = 3 if state_residence == 02
|
|
|
replace state = 4 if state_residence == 03
|
|
|
replace state = 5 if state_residence == 04
|
|
|
replace state = 6 if state_residence == 05
|
|
|
replace state = 7 if state_residence == 06
|
|
|
replace state = 8 if state_residence == 07
|
|
|
replace state = 9 if state_residence == 08
|
|
|
replace state = 10 if state_residence == 09
|
|
|
replace state = 11 if state_residence == 10
|
|
|
replace state = 12 if state_residence == 51
|
|
|
replace state = 13 if state_residence == 11
|
|
|
replace state = 14 if state_residence == 12
|
|
|
replace state = 15 if state_residence == 13
|
|
|
replace state = 16 if state_residence == 14
|
|
|
replace state = 17 if state_residence == 15
|
|
|
replace state = 18 if state_residence == 16
|
|
|
replace state = 19 if state_residence == 17
|
|
|
replace state = 20 if state_residence == 18
|
|
|
replace state = 21 if state_residence == 19
|
|
|
replace state = 22 if state_residence == 20
|
|
|
replace state = 23 if state_residence == 21
|
|
|
replace state = 24 if state_residence == 22
|
|
|
replace state = 25 if state_residence == 23
|
|
|
replace state = 26 if state_residence == 24
|
|
|
replace state = 27 if state_residence == 25
|
|
|
replace state = 28 if state_residence == 26
|
|
|
replace state = 29 if state_residence == 27
|
|
|
replace state = 30 if state_residence == 28
|
|
|
replace state = 31 if state_residence == 29
|
|
|
replace state = 32 if state_residence == 30
|
|
|
replace state = 33 if state_residence == 31
|
|
|
replace state = 34 if state_residence == 32
|
|
|
replace state = 35 if state_residence == 33
|
|
|
replace state = 36 if state_residence == 34
|
|
|
replace state = 37 if state_residence == 35
|
|
|
replace state = 38 if state_residence == 36
|
|
|
replace state = 39 if state_residence == 37
|
|
|
replace state = 40 if state_residence == 38
|
|
|
replace state = 41 if state_residence == 39
|
|
|
replace state = 42 if state_residence == 40
|
|
|
replace state = 43 if state_residence == 41
|
|
|
replace state = 44 if state_residence == 42
|
|
|
replace state = 45 if state_residence == 43
|
|
|
replace state = 46 if state_residence == 44
|
|
|
replace state = 47 if state_residence == 45
|
|
|
replace state = 48 if state_residence == 46
|
|
|
replace state = 49 if state_residence == 47
|
|
|
replace state = 50 if state_residence == 48
|
|
|
replace state = 51 if state_residence == 49
|
|
|
|
|
|
|
|
|
|
|
|
g mstat = cond(marital_status_head != 1, 1, 2)
|
|
|
|
|
|
replace mstat = 3 if mstat == 1 & children > 0
|
|
|
|
|
|
|
|
|
g depx = children
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g pwages = labor_inc_head + business_labor_income_head
|
|
|
g swages = (labor_inc_wife+business_labor_income_wife)*(mstat==2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g gssi = socsec_income_hh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g transfers = vapension_inc_head + workerscomp_inc_head + tanf_inc_head +
|
|
|
otherwelfare_inc_head + childsupport_inc_head + transf_rel_head +
|
|
|
ssi_head+
|
|
|
(mstat==2)*(workerscomp_inc_wife + tanf_inc_wife + otherwelfare_inc_wife +
|
|
|
childsupport_inc_wife + transf_rel_wife + ssi_wife)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g ui = unemployment_inc_head + unemployment_inc_wife
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g depchild = children
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g otherprop=annira_head+pension_wife+business_asset_income_head+business_asset_income_wife
|
|
|
|
|
|
|
|
|
g pensions = nonva_retir_head+other_pen_head
|
|
|
|
|
|
|
|
|
replace pwages = pwages - stat_pen_contrib_head
|
|
|
replace swages = swages - stat_pen_contrib_wife
|
|
|
|
|
|
|
|
|
|
|
|
taxsim9, full replace
|
|
|
|
|
|
di "TAXSIM FOR YEAR `x' OVER"
|
|
|
|
|
|
|
|
|
gen pretax_income = pwages + swages + transfers + gssi + ui + otherprop + pensions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rename fiitax federalTax
|
|
|
rename siitax stateTax
|
|
|
gen aftertax_income_defl = (pretax_income - federalTax - stateTax)*(`cpi1999' / `cpi`x'')
|
|
|
|
|
|
|
|
|
drop if aftertax_income_defl<0
|
|
|
|
|
|
|
|
|
gen nr_adult = size_fam-depchild
|
|
|
gen equiv = 1.0 + 0.7*(nr_adult-1) + 0.5*depchild
|
|
|
gen aftertax_income_defl_equiv= aftertax_income_defl/equiv
|
|
|
|
|
|
|
|
|
keep aftertax_income_defl_equiv age_head year_survey ed_head marital_status_head fam_ID_1968 fam_ID_year size_fam equiv state_residence
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
save "`procdata'/temp`x'.dta",replace
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|