R-TUTORIAL FOR TIES IN THE NELSON-AALEN ESTIMATOR In this exercise we consider two ways of handling tied failure times when computing Nelson-Aalen estimates. For illustration we will use the leukemia data described in exercise 3.1 in the ABG-book. The data may be read into R by the command: leukemia=read.table("https://www.mn.uio.no/math/english/people/aca/borgan/data/leukemia.txt", header=T) The leukemia data contain a number of ties failure times. As described in section 3.1.3 in the ABG-book there are two ways these may be handled; cf. formulas (3.12) (called the "efron" method) and (3.13) (called the "breslow" method). . The following commands compute Nelson-Aalen estimates for the placebo group according to the two ways of handling tied observations (the estimates are found as minus the logarithm of an estimate of the survival function): fit.b=coxph(Surv(time,status)~1, data=leukemia, subset=(treat==1), method="breslow") surv.b=survfit(fit.b) fit.e=coxph(Surv(time,status)~1, data=leukemia, subset=(treat==1), method="efron") surv.e=survfit(fit.e) cbind(surv.b$time,-log(surv.b$surv),-log(surv.e$surv)) Note that the difference between the commands is the choice of method for handling tied failure times, specified as the "breslow" method and the "efron" method (the latter being the default in R). ----------------- Then we consider the variance estimates. The command cbind(surv.b$time,surv.b$std.err^2,surv.e$std.err^2) gives a table of the estimated variances. The "efron" method corresponds to formula (3.15) in the book. The "breslow" option in R does, however, not correspond to formula (3.16) in the book. Rather, it simply is the sum of terms d_j/Y(T_j)^2 at time T_j. -----------