[R] how to extrac one coef from lm at a time

Andrew Robinson andrewr at uidaho.edu
Tue May 21 18:01:59 CEST 2002


coef(model.lm)[1] and coef(model.lm)[2]

It's just extracting elements from a vector.  Pretty neat, too, I think.

A.

At 12:07 PM 5/21/2002 -0300, you wrote:
>Hello R-Users,
>
>I have I simple question that I could not solve:
>
>How to extract the elevation and the slope values from a linear model (lm)
>separately?
>
>coef(model.lm) gives both of them.
>
>Thanks,
>
>Antonio Olinto
>
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>Send "info", "help", or "[un]subscribe"
>(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list