library(survival)
vfit <- coxph(Surv(time,status) ~ trt + factor(celltype) +
karno + age, data=veteran, x=TRUE)
temp <- cox.zph(vfit)
par(mfrow=c(2,2))
for (v in c("trt","age")) {
VEplot(temp, var=v, resid=FALSE, main=v, ylab="VE")
plot(temp, var=v, resid=FALSE, main=v)
}
Run the code above in your browser using DataLab