T<-c(1,1,2,2,2,3,3,3,3,4,4,5,8,8,8) d<-c(0,0,1,0,0,1,1,1,0,0,0,1,1,0,0) library(survival) s<-Surv(T,d) ?survfit kmpl<-survfit(s~1,conf.type="p") kmlog<-survfit(s~1,conf.type="log") kmllog<-survfit(s~1,conf.type="log-log") plot(c(0,8),c(0,1),type="n") lines(kmpl,conf.int=F,lwd=2) lines(kmpl,conf.int="only",col=2) lines(kmlog,conf.int="only",col=3) lines(kmllog,conf.int="only",col=4) napl<-survfit(s~1,conf.type="p",type="fh") nalog<-survfit(s~1,conf.type="log",type="fh") nallog<-survfit(s~1,conf.type="log-log",type="fh") plot(c(0,8),c(0,3),type="n") lines(napl,conf.int=F,lwd=2,fun="cumhaz") lines(napl,conf.int="only",col=2,fun="cumhaz") lines(nalog,conf.int="only",col=3,fun="cumhaz") lines(nallog,conf.int="only",col=4,fun="cumhaz") par(mfrow=c(2,3)) plot(kmpl,col=2) plot(kmlog,col=3) plot(kmllog,col=4) plot(napl,col=2,fun="cumhaz") plot(nalog,col=3,fun="cumhaz") plot(nallog,col=4,fun="cumhaz") # The first option causes confidence intervals not to be generated. # The second causes the standard intervals curve +- k *se(curve), where k is determined from conf.int. # The log option calculates intervals based on the cumulative hazard or log(survival). # The last option bases intervals on the log hazard or log(-log(survival)).