#=====> 5. Kaplan-Meier confidence bands <=====#
data(bmt)
attach(bmt)
mySurv <- Surv(t2[group==1], d3[group==1])
#pdf("confBand.pdf", 7, 4.5)
#par(mar=c(3.9, 3.9, 2.5, 1), mgp=c(2.6, 0.7, 0))
plot(survfit(mySurv ~ 1), xlim=c(100, 600), xlab='time',
ylab='Estimated Survival Function',
main='Reproducing Confidence Bands, bone marrow transplant')
myCB <- confBands(mySurv)
lines(myCB, lty=3)
legend(100, 0.3, legend=c('K-M survival estimate',
'pointwise intervals','EP confidence bands'), lty=1:3)
#dev.off()
detach(bmt)
Run the code above in your browser using DataLab