# EXERCISE 3.9 # ============= # Read leukemia data: leukemia=read.table("http://folk.uio.no/borgan/abg-2008/data/leukemia.txt",header=T) # We will use the survival library, so this has to be loaded. # We may plot the Nelson-Aalen estimates for the two groups (cf exercise 3.1): fit=coxph(Surv(time,status)~strata(treat),data=leukemia) surv=survfit(fit) plot(surv,fun="cumhaz", mark.time=F,xlim=c(0,25),ylim=c(0,4), xlab="Weeks",ylab="Cumulative hazard",lty=1:2) legend("topleft",c("Placebo","6-MP"),lty=1:2) # To test if the observed difference is significant, we may use the logrank test: survdiff(Surv(time,status)~treat,data=leukemia) # We find that the difference is highly significant.