Re: [R] Quick question about lm()

From: Christos Hatzis <christos_at_nuverabio.com>
Date: Tue 05 Sep 2006 - 05:52:29 GMT


Say,

my.lm <- lm(y ~ x, data=my.data)

Then if you try:

names(summary(my.lm))

you will see the components of the summary.lm object. The coefficients and t-statistics can be extracted by

summary(my.lm)$coefficients

and similarly for the r-squared and other statistics provided in the summary report.

-Christos  

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Tong Wang Sent: Tuesday, September 05, 2006 1:35 AM To: r-help@stat.math.ethz.ch
Subject: [R] Quick question about lm()

Hi,

     Feel awkward to ask , but really couldn't find a answer anywhere, How could I extract the R^2 and t-stat. from the result of lm()?

     Thanks a lot.

best



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Sep 05 15:58:02 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.