# library(survival) plot(survfit(aml.maint)) # plot K-M summary(survfit(aml.maint)) # show K-M computations print(survfit(aml.maint),show.rmean=T) # K-M based inference a <- summary(survfit(aml.maint)) # S(13) estimation and CI 10/11 * 9/10 cumprod( (a$n.risk -a$n.event) /a$n.risk) a$surv[2] * sqrt( 1/110 + 1/90) (mn <- log(0.818)) (sd <- sqrt(1/110 + 1/90)) (ll <- exp( mn - qnorm(0.975)*sd)) (ul <- exp( mn + qnorm(0.975)*sd)) summary(survfit(aml.maint,conf.type="plain")) # Restricted mean estimation print(survfit(aml.maint),show.rmean=T) a t.i <- c(0,a$time,161) surv.i <- c(1,a$surv) sum(diff(t.i) * surv.i)