Day 7
Survival Analysis
CHD and coffee
• Is there an association between CHD and
coffee consumption?
• Outcome: Time to onset of CHD
Survival Data in Stata
• stset chdage chd
• Generally,
– stset failtime cens
– where cens = 0 if failure is NOT observed
Kaplan Meier Survival Curves
• sts graph
• sts graph, noorigin yasis atrisk
• sts graph, noorigin censored(multiple)
• sts graph, by(cafe)
yline(0.70,0.80,0.90,1)
• sts graph, by(cafe) noorigin cens(mult)
Testing Equality of Survival
Curves
• Logrank Test
– sts test cafe
– sts test cholcat
– sts test cholcat2
• Wilcoxon
– sts test café, wilco
Listing Survival Statistics
• sts list
• sts list, by(cafe) compare
Cox Proportional Hazards Model
• Gives “relative risk,” defined as hazard ratio
• E.g., tells increased risk for coffee drinkers
for any given age.
– stcox cafe
– stcox cholcat2
– stcox cafe cholcat2 basesmoke