cap log close clear log using StataLog, replace include "http://192.38.117.59/~linearpredictors/datafiles/readPbc3.do" xtile biligroup = bili, nq(5) egen biliQuintileMeans = mean(bili), by(biligroup) label variable biliQuintileMeans "Mean level of bilirubin within quintile groups" /* Size of quintile groups, and groupwise means */ table biliQuintileMeans /* Declare data to be survival-time data */ quietly stset followup, failure(status == 1 2) /* Observed and expected no of failures */ xi: sts test i.biligroup log close