c1 <- coxph(formula = Surv(time, status == 2) ~ age + log(bili), data=pbc)
E <- predict(c1, type="expected")
as.Surv(pbc$time, E)
summary(coxph(as.Surv(pbc$time, E) ~ log(pbc$bili)))
### Warning:
### In Surv(stime, sstat) : Invalid status value, converted to NA
Run the code above in your browser using DataLab