# PRACTICAL EXERCISE 6 # ==================== # Read bonemarrow transplantation data: path="http://www.uio.no/studier/emner/matnat/math/STK4080/h14/bone-marrow.txt" bonemarrow=read.table(path,header=T) # We will use the survival package, so this has to be loaded. library(survival) # Question a # We make Nelson-Aalen plots for the cumulative relapse-free survival hazards for the three disease groups: fit.group=coxph(Surv(T2,DF)~strata(g),data=bonemarrow) surv.group=survfit(fit.group) plot(surv.group,fun="cumhaz", mark.time=F,xlim=c(0,1000),xlab="Days post-transplant",ylab="Cumulative hazard",lty=1:3) legend("topleft",c("ALL","AML low-risk","AML high-risk"),lty=1:3) # Qustion b # We use the logrank test to see if the observed differences are significant: survdiff(Surv(T2,DF)~g,data=bonemarrow) # We find that the disease groups are significantly different (p-value 0.1%).