[R] getting the std errors in the lm function
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Mon Mar 8 12:32:54 CET 2004
Fulvio Copex <copellifulvio at yahoo.it> writes:
> Hello,
> I have a simple question for you:
> making:
> mylm<-lm(y~x)
> summary(mylm)
> I get the following results:
> ******************************************************
> Coefficients:
> Estimate Std. Error t value Pr(>|t|)
> (Intercept) 16.54087 0.19952 82.91 <2e-16 ***
> x[1:19] -2.32337 0.04251 -54.66 <2e-16 ***
> ******************************************************
> now I can access easily with
> mylm$coefficients[[1]]
> mylm$coefficients[[2]]
> at the Estimate 16.54087 and -2.32337.
[coefficients(mylm)[[1]] would be preferable]
> how can I access at the Std. Error 0.19952 and 0.04251 ?
m <- coefficients(summary(mylm))
m[1,2]
m[2,2]
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list