[R] Median In Survival

David Winsemius dwinsemius at comcast.net
Thu Feb 23 02:47:51 CET 2012


On Feb 22, 2012, at 6:59 PM, niloo javan wrote:

> hi
> I have a problem with  Median in Survival.
> when I use
> S1=survfit(Surv(Time,Status))
> the result shows the median but I cannot use it as numeric!
> S1$median in Null

That does not look like a formula.

  Furthermore I do not think there is an element in a survfit.object  
named 'median'. (It's certainly not documented on the help pages.)   
Objects are passed to their print methods and the `print.survfit`  
function passes off its data argument first to `survmean`, then to  
`pfun`, then to `minmin` which does the job of calculating a median,  
which print.survfit then prints (as a side-effect using `cat`), but  
never stores in a returned object.

Is this is homework?


-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list