[R] Extracting standard error from survreg?

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Wed Oct 15 17:48:44 CEST 2008


> On Wed, 15 Oct 2008, Peter Dalgaard wrote:
> 
> > jpl wrote:
> > Hello,
> >
> > I would like to extract the standard error for the coefficients 
> > returned when using survreg.  Does anyone know how to do this?
> 
> Apparently, it is
> 
> summary(mymodel)$table[,2]

In order not to compute on the internal structure but to use extractor 
methods, you could use
   vcov(mymodel)
and
   sqrt(diag(vcov(mymodel)))
for the covariance matrix and the standard errors respectively.

> (Why, oh why, can't Terry allow coef(summary(...)) like we have in
> lm/glm??? Oh well...)

Is that desired or just a by-product? From the description of the coef() 
generic, it seems that coef() should only extract coefficients (not their 
standard errors, Wald statistics, and p values).
Z



More information about the R-help mailing list