[R] Extracting standard error from survreg?

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Wed Oct 15 18:49:54 CEST 2008


Achim Zeileis wrote:
>> 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).
Good question. It's likely mostly coincidental, but it wouldn't hurt to
use the construction idiomatically.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list