**** pe vs. pd **** * Use Smoking-Mortality as a real example in NHIS Data * Ages 50-84 attained age * Ages 40-84 baseline age * PAF from cigarette smoking * Confounders are gender, race/ethnicity, and age * Poor Health and Institutionalization (i.e., collider bias / survey selection bias) use "F:\Private\ryma0788\obesity_mortality\NHIS\nhis_healthy.dta", clear drop if agecalc < 40 drop if age_e >= 85 drop if age_e < 50 drop if hispanic == 1 drop if nhother == 1 drop if nhblack == . drop age_e replace yexpose = .25 if yexpose == 0 gen age_e = agecalc+yexpose drop if mortwt == 0 * Smoking Status * Never * Former * Current gen nsmoker = . replace nsmoker = 0 if smoke1 == 20 replace nsmoker = 0 if smoke1 >= 30 & smoke1 <= 32 replace nsmoker = 0 if smoke1 == 92 replace nsmoker = 1 if smoke1 == 10 replace nsmoker = 1 if smoke2 == 30 gen fsmoker = . replace fsmoker = 0 if smoke1 == 10 replace fsmoker = 0 if smoke1 == 20 replace fsmoker = 1 if smoke1 >= 30 & smoke1 <= 32 replace fsmoker = 1 if smoke1 == 92 replace fsmoker = 1 if smoke2 == 20 replace fsmoker = 1 if smoke2 == 40 gen smoker = . replace smoker = 0 if smoke1 == 10 replace smoker = 0 if smoke1 >= 30 & smoke1 <= 32 replace smoker = 0 if smoke1 == 92 replace smoker = 1 if smoke1 == 20 replace smoker = 1 if smoke2 >= 10 & smoke2 <= 13 replace nsmoker = 0 if smoker == 1 replace fsmoker = 0 if smoker == 1 drop if smoker == . gen men = 0 replace men = 1 if sex == 1 gen cage = agecalc - 50 gen cage2 = cage*cage sum birthyr gen cbirth = birthyr - 1940 gen cbirth2 = cbirth*cbirth * Likelihood of Smoking Confounded by Sex and Race/Ethnicity gen bmen = nhblack*men logit smoker cage cage2 cbirth cbirth2 men nhblack bmen if fsmoker==0 & age_e > 50, or * White Men have 65% higher odds of smoking than never smoking compared to White Women * Black Women have 4% lower odds of smoking than never smoking compared to White Women * Black Men have 120% higher odds of smoking than never smoking compared to White Women logit fsmoker cage cage2 cbirth cbirth2 men nhblack bmen if smoker==0 & age_e > 50, or * White Men have 138% higher odds of former smoking than never smoking compared to White Women * Black Women have 35% lower odds of former smoking than never smoking compared to White Women * Black Men have 63% higher odds of former smoking than never smoking compared to White Women gen status = . replace status = 1 if nsmoker==1 replace status = 2 if fsmoker==1 replace status = 3 if smoker ==1 gen group = . replace group = 1 if nhwhite==1 & men == 1 replace group = 2 if nhblack==1 & men == 1 replace group = 3 if nhwhite==1 & men == 0 replace group = 4 if nhblack==1 & men == 0 gen id = _n stset age_e [pweight = mortwt], failure(mort==1) enter(time agecalc) id(id) sts graph if age_e > 50, by(status) noorigin xscale(range(40 85)) tab group _d if age_e > 50 * Split Ages into 10yr Blocks stsplit agecat, at(50,60,70,80) tab agecat _d drop if agecat == 0 gen smkage = smoker*cage gen smkage2 = smoker*cage2 gen fsmkage = fsmoker*cage gen fsmkage2 = fsmoker*cage2 * pe tab status * pe by age tab agecat status * Confounder-specific pe with agecat bysort group: tab agecat status * pd tab status if _d == 1 * pd by age tab agecat status if _d == 1 * Confounder-specific pd with agecat bysort group: tab agecat status if _d == 1 * Observed RRRs tab agecat _d if nsmoker==1 tab agecat _d if fsmoker==1 tab agecat _d if smoker==1 gen s50 = smoker*(agecat == 50) gen s60 = smoker*(agecat == 60) gen s70 = smoker*(agecat == 70) gen s80 = smoker*(agecat == 80) gen fs50 = fsmoker*(agecat == 50) gen fs60 = fsmoker*(agecat == 60) gen fs70 = fsmoker*(agecat == 70) gen fs80 = fsmoker*(agecat == 80) **** Model 1: Baseline **** * no age included * cloglog _d i.status predict base_hat tabulate status, sum(base_hat)means **** Model 2: Age-specific **** cloglog _d i.status#i.agecat predict age_hat tabulate agecat status, sum(age_hat)means **** Model 3: Confounder **** cloglog _d i.status#i.agecat men nhblack **** Model 3: Confounder-specific **** cloglog _d i.status#i.agecat if men==1 & nhwhite==1 cloglog _d i.status#i.agecat if men==1 & nhblack==1 cloglog _d i.status#i.agecat if men==0 & nhwhite==1 cloglog _d i.status#i.agecat if men==0 & nhblack==1 * Proportion of Deaths by Race/Eth & Gender tab group _d * Get Proportion of TOTAL deaths (not just within-group) tab agecat _d if group==1 tab agecat _d if group==2 tab agecat _d if group==3 tab agecat _d if group==4 **** Model 4: Age-related Bias for pd **** xi: cloglog _d i.status*i.agecat cbirth cbirth2 cage cage2 smkage smkage2 men nhblack **** Model 3: Age-related Bias, Confounder-specific **** cloglog _d i.status#i.agecat cbirth cbirth2 cage cage2 smkage smkage2 if men==1 & nhwhite==1 cloglog _d i.status#i.agecat cbirth cbirth2 cage cage2 smkage smkage2 if men==1 & nhblack==1 cloglog _d i.status#i.agecat cbirth cbirth2 cage cage2 smkage smkage2 if men==0 & nhwhite==1 cloglog _d i.status#i.agecat cbirth cbirth2 cage cage2 smkage smkage2 if men==0 & nhblack==1 ***** Frailty Model ***** * REs for 5yr age groupings on Age-at-Baseline gen a4550 = 0 replace a4550 = 1 if agecalc < 50 gen a5055 = 0 replace a5055 = 1 if agecalc >= 50 & agecalc < 55 gen a5560 = 0 replace a5560 = 1 if agecalc >= 55 & agecalc < 60 gen a6065 = 0 replace a6065 = 1 if agecalc >= 60 & agecalc < 65 gen a6570 = 0 replace a6570 = 1 if agecalc >= 65 & agecalc < 70 gen a7075 = 0 replace a7075 = 1 if agecalc >= 70 & agecalc < 75 gen a7580 = 0 replace a7580 = 1 if agecalc >= 75 & agecalc < 80 gen a8085 = 0 replace a8085 = 1 if agecalc >= 80 gen bagecat = . replace bagecat = 1 if a4550 == 1 replace bagecat = 2 if a5055 == 1 replace bagecat = 3 if a5560 == 1 replace bagecat = 4 if a6065 == 1 replace bagecat = 5 if a6570 == 1 replace bagecat = 6 if a7075 == 1 replace bagecat = 7 if a7580 == 1 replace bagecat = 8 if a8085 == 1 * Cohort of Entry (5yr Age) stratified cloglog _d i.status#i.agecat if bagecat == 1 cloglog _d i.status#i.agecat if bagecat == 2 cloglog _d i.status#i.agecat if bagecat == 3 cloglog _d i.status#i.agecat if bagecat == 4 cloglog _d i.status#i.agecat if bagecat == 5 cloglog _d i.status#i.agecat if bagecat == 6 cloglog _d i.status#i.agecat if bagecat == 7 * Estimate Shared Frailty for 5-year cohorts of survey age mecloglog _d i.agecat cbirth cbirth2 men nhblack if smoker ==1 || bagecat: mecloglog _d fsmoker#i.agecat cbirth cbirth2 men nhblack if smoker ==0 || bagecat: , intpoints(4) **** Strat by Confounders **** mecloglog _d i.agecat cbirth cbirth2 if smoker ==1 & nhwhite==1 & men==1 || bagecat: , intmethod(mcaghermite) mecloglog _d fsmoker#i.agecat cbirth cbirth2 if smoker ==0 & nhwhite==1 & men==1 || bagecat: , intmethod(mcaghermite) intpoints(5) mecloglog _d i.agecat cbirth cbirth2 if smoker ==1 & nhblack==1 & men==1 || bagecat: , intmethod(mcaghermite) intpoints(5) mecloglog _d fsmoker#i.agecat cbirth cbirth2 if smoker ==0 & nhblack==1 & men==1 || bagecat: , intmethod(mcaghermite) intpoints(4) mecloglog _d i.agecat cbirth cbirth2 if smoker ==1 & nhwhite==1 & men==0 || bagecat: , intmethod(mcaghermite) mecloglog _d fsmoker#i.agecat cbirth cbirth2 if smoker ==0 & nhwhite==1 & men==0 || bagecat: , intmethod(mcaghermite) intpoints(5) mecloglog _d i.agecat cbirth cbirth2 if smoker ==1 & nhblack==1 & men==0 || bagecat: , intmethod(mcaghermite) intpoints(4) mecloglog _d fsmoker#i.agecat cbirth cbirth2 if smoker ==0 & nhblack==1 & men==0 || bagecat: , intmethod(mcaghermite) intpoints(3)