Skip to content
Prev 170774 / 398506 Next

Survival-Analysis: How to get numerical values from survfit (and not just a plot)?

I seriously doubt that a survfit object could only contain that  
information. I suspect that you are erroneously thinking that what  
print.survfit offers is the entire story.

What does str(survfit(<formula>, data=<dataframe>) ) show you?

 > data(aml)
 > aml.mdl <- survfit(Surv(time, status) ~ x, data=aml)
# this is with survfit.Design since I load Hmisc/Design by default now.
 > str(aml.mdl)
List of 18
  $ n            : int 23
  $ time         : num [1:20] 9 13 18 23 28 31 34 45 48 161 ...
  $ n.risk       : num [1:20] 11 10 8 7 6 5 4 3 2 1 ...
  $ n.event      : num [1:20] 1 1 1 1 0 1 1 0 1 0 ...
  $ surv         : num [1:20] 0.909 0.818 0.716 0.614 0.614 ...
  $ type         : chr "right"
  $ ntimes.strata: Named int [1:2] 10 10
   ..- attr(*, "names")= chr [1:2] "1" "2"
  $ strata       : Named num [1:2] 10 10
   ..- attr(*, "names")= chr [1:2] "Maintained" "Nonmaintained"
  $ strata.all   : Named int [1:2] 11 12
   ..- attr(*, "names")= chr [1:2] "Maintained" "Nonmaintained"
  $ std.err      : num [1:20] 0.0953 0.1421 0.1951 0.2487 0.2487 ...
  $ upper        : num [1:20] 0.987 0.951 0.899 0.835 0.835 ...
  $ lower        : num [1:20] 0.508 0.447 0.35 0.266 0.266 ...
  $ conf.type    : chr "log-log"
  $ conf.int     : num 0.95
  $ maxtime      : num 161
  $ units        : chr "Day"
  $ time.label   : chr "time"
  $ call         : language survfit(formula = Surv(time, status) ~ x,  
data = aml)
  - attr(*, "class")= chr "survfit"
 >

I also don't think survfit returns a Cox model.
On Feb 17, 2009, at 10:37 AM, Bernhard Reinhardt wrote: