Skip to content
Prev 275010 / 398506 Next

Survival analysis

On Oct 20, 2011, at 5:05 PM, Sarah Goslee wrote:

            
I suspect that Cem Girit is attempting to use survival::survfit and  
survival::print.survfit, to get group means.  (He also spelled his vT  
variable differently in two places.)  He seems confused about how to  
offer arguments to the print.rmean and rmean paramters. He had been  
advised by Therneau to read:

?print.survfit   # where the details of the rmean calculation are  
discussed

Both parameters are expecting a value of TRUE to be invoked, and he  
was both misnaming them and mis-specifying them. Their default values  
are:

 > getOption('survfit.rmean')
NULL
 > getOption("survfit.print.rmean")
NULL

After changing the name of "vt" to "vT":

 > print(fit,print.rmean=TRUE)
Call: survfit.formula(formula = Surv(dT, vT) ~ gT)

            records n.max n.start events *rmean *se(rmean) median  
0.95LCL 0.95UCL
gT=DrugA         9     9       9      6   50.0       3.11     48       
45      NA
gT=DrugB         9     9       9      3   54.8       2.93     NA       
43      NA
gT=DrugC         9     9       9      4   53.8       2.74     NA       
47      NA
gT=Vehicle       9     9       9      8   42.3       2.38     40       
38      NA
     * restricted mean with upper limit =  61

If an overall rmean were desired it would be obtained thusly:

 > print(fit,print.rmean=TRUE)
Call: survfit.formula(formula = Surv(dT, vT) ~ 1)

    records      n.max    n.start     events     *rmean *se(rmean)      
median
       36.0       36.0       36.0       21.0       50.5         
1.7       47.0
    0.95LCL    0.95UCL
       43.0         NA
     * restricted mean with upper limit =  62