# NOT RUN {
data(TRACE)
cox <- coxph(Surv(time,status==9)~vf+chf+wmi,data=TRACE)
sim1 <- sim.cox(cox,1000,data=TRACE)
cc <- coxph(Surv(time,status)~vf+chf+wmi,data=sim1)
cbind(cox$coef,cc$coef)
cor(sim1[,c("vf","chf","wmi")])
cor(TRACE[,c("vf","chf","wmi")])
# }
# NOT RUN {
### do not test to avoid dependence on mets
library(mets)
cox <- phreg(Surv(time, status==9)~vf+chf+wmi,data=TRACE)
sim3 <- sim.cox(cox,1000,data=TRACE)
cc <- phreg(Surv(time, status)~vf+chf+wmi,data=sim3)
cbind(cox$coef,cc$coef)
basehazplot.phreg(cox,se=TRUE)
lines(cc$cumhaz,col=2)
cox <- phreg(Surv(time,status==9)~strata(chf)+vf+wmi,data=TRACE)
sim3 <- sim.cox(cox,1000,data=TRACE)
cc <- phreg(Surv(time, status)~strata(chf)+vf+wmi,data=sim3)
cbind(cox$coef,cc$coef)
basehazplot.phreg(cox)
basehazplot.phreg(cc,add=TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab