# An example used in Royston and Sauerbrei
pbc2 <- na.omit(pbc) # no missing values
cfit <- coxph(Surv(time, status==2) ~ age + log(bili) + edema + albumin +
stage + copper, data=pbc2, ties="breslow")
royston(cfit)
Run the code above in your browser using DataLab