Skip to content

Survreg object

3 messages · andre bedon, David Winsemius, Brian Ripley

#
On May 14, 2011, at 5:48 AM, andre bedon wrote:

            
I do not see an se.coef extractor function in the help pages for  
survreg or survreg.object, so I guess you need to make one:

fit <- survreg(Surv(futime, fustat) ~ ecog.ps + rx, ovarian,  
dist='weibull',
                                     scale=1)
Two methods seem to be equivalent on the first example in help(survreg):

summary(fit)$table[ , "Std. Error"]
(Intercept)     ecog.ps          rx
   1.3218774   0.5869936   0.5869936

sqrt(diag(fit$var))
(Intercept)     ecog.ps          rx
   1.3218774   0.5869936   0.5869936

The first one is preferred because after looking at the  
summary.survreg function, one sees that it first checks for other  
conditions that were recorded in the fit object and only if those are  
met does it apply the second method, and it further checks to see if  
robust errors had been requested.

There can be some risk in creating your own extraction methods, since  
the author of a package may have had reasons for not making it  
available, but in this case he did offer a table that includes the  
component you were requesting.

David Winsemius, MD
West Hartford, CT
#
There is however the generic vcov(), which has a method for class 
"survreg".

One good reason for not having a simple means to extract standard 
errors is that considering coefficients in isolation is often unwise 
(and has come up on R-help more than once already this month).

The summary() method for class "survreg", like many other 
model-fitting functions, has an argument 'correlation'. In the mid 
1990s for S(-PLUS) the default for this argument was usually true.  I 
can see why the R tradition changed to false, but reminding people of 
the correlation matrix when printing the coefficient table had merit.
On Sat, 14 May 2011, David Winsemius wrote: