log using "table1.log", replace *** * product: none; no data product * produce exhibit Table1; summary statistics (mean and SD) and t-test between HRS2006 and full 10-year follow-up sample * indata: HTS stock 2006; mortality_hrs_confirmed.dta; confirmed_cogcat2006.dta * outdata: none * exhibits: Table1 * dependent files: "../hrs/mortality_hrs_confirmed.dta". "../fem/confirmed_cogcat2006.dta" *** use ../../../input_data/stock_hrs_2006.dta, clear keep if wave==8 keep if iwstat==1 keep if age >= 53 gen totcog_06 = totcog - 1 gen male_hsless = male*hsless gen male_black = male*black gen male_hispan = male*hispan /* Create age spline indicator variables */ gen l2age65l = 63 if 63 < l2age replace l2age65l = l2age if l2age <= 63 gen temp_max = 0 if l2age-63<0 replace temp_max = l2age-63 if l2age-63>0 gen l2age6574 = 10 if 10 < temp_max replace l2age6574 = temp_max if temp_max <= 10 gen l2age75p = 0 if 0 > l2age-73 replace l2age75p = l2age-73 if l2age-73 >= 0 mdesc totcog_06 mi set wide mi misstable summarize totcog_06 mi register imputed totcog_06 mi impute ologit totcog_06 = black hispan hsless college male male_hsless male_black male_hispan l2age65l l2age6574 l2age75p hearte stroke cancre hibpe diabe lunge hearta work widowed smokev, add(5) rseed(2020) merge m:1 hhidpn using mortality_hrs_confirmed.dta, keepusing(hhidpn) gen fullflag = . replace fullflag = 0 if _merge==1 replace fullflag = 1 if _merge==3 drop _merge foreach var in age totcog_06 { mi estimate: regress `var' fullflag [pw=weight] } foreach var in white black hispan college hsless hearte stroke cancre hibpe diabe lunge hearta work widowed smokev { mi estimate: probit `var' fullflag [pw=weight] } foreach var in age white black hispan college hsless totcog_06 hearte stroke cancre hibpe diabe lunge hearta work widowed smokev { mi estimate: mean `var' [pw=weight] mi estimate: mean `var' [pw=weight], over(fullflag) } clear use "../fem/confirmed_cogcat2006.dta", clear merge 1:1 hhidpn using mortality_hrs_confirmed.dta, keepusing(hhidpn) gen fullflag = . replace fullflag = 0 if _merge==1 replace fullflag = 1 if _merge==3 drop _merge oprobit confirmed_cogcat_hrs2006_nomi fullflag [pw=weight_hrs8] foreach var in confirmed_ad confirmed_mci confirmed_normal { mean `var' [pw=weight_hrs8] mean `var' [pw=weight_hrs8], over(fullflag) } log close