/* Specifying a Cox Proportional Hazards Model */ use http://www.stata-press.com/data/r9/drugtr, clear /* st allows us to see how the data is set for survival analysis */ stset studytime, failure(died) /* Let's have a look at our variables before we get started */ summarize /* Let's specify a model to measure the efficacy of our drug on the cancer patients controlling for age*/ stcox drug age /* We see that the drug results in a lower hazard-therefore a longer survival time-controlling for age */ /* Now let's report relative risk (the hazard ratio) for a more standard five-year change */ replace age = age/5 stcox drug age, bases(s) nolog line s _t, sort c(j)