log using dist_2016.log, replace *** * product: none * generate descriptive statistics on FEM 2016 TICS * indata: FEM 2016 simulation detailed outputs * outdata: FEM 2016 TICS summary * exhibits: Table3 FEM; Graph1 * dependent files: none *** quietly include ../../../fem_env.do local maxrep 500 local minyr 2006 local maxyr 2016 forvalues fold=1/5 { forvalues rep = 1/`maxrep' { append using ../../../output/5fcv`fold'/detailed_output/y2016_rep`rep'.dta } } drop if died==1 keep if age>=63 gen totcog_si = totcog - 1 bys hhidpn mcrep (year): keep if _n == _N rename totcog_si totcog16 rename weight weight16 sum totcog16 [aweight=weight16], de tab totcog16 [aweight=weight16] gen cogcat16 = . replace cogcat16 = 1 if totcog16 <= 6 replace cogcat16 = 2 if totcog16 >= 7 & totcog16 <= 11 replace cogcat16 = 3 if totcog16 >= 12 & totcog16 <= 27 rename cogstate cogstate16 keep weight16 totcog16 cogcat16 hhidpn mcrep cogstate16 tab cogcat16 [aweight=weight16] tab cogstate16 [aweight=weight16] save fem2016_short_5fcv.dta, replace log close