以library("survival"), survfit 為例:
Data.surv<-survfit(Surv(months, death)~ strata(Datacut))
> Data.surv
Call: survfit(formula = Surv(months, death) ~ strata(Datacut))
records n.max n.start events median 0.95LCL 0.95UCL
strata(Datacut)=Datacut=0 82 82 82 27 5.67 3.53 NA
strata(Datacut)=Datacut=1 76 76 76 36 2.68 1.70 NA
今要取出median value 故以
x<-read.table(textConnection(capture.output(Data.surv)),skip=2,header=TRUE)
x$median
即可以得到 [1] 5.67 2.68