[R] extract R-squared and P-value from lm results

Chuck Cleland ccleland at optonline.net
Fri Jan 29 15:12:19 CET 2010


On 1/29/2010 9:04 AM, wenjun zheng wrote:
> Hi, R Users
> 
> I find a problem in extracting the R-squared and P-value from the lm results
> described below (in Italic),
> 
> *Residual standard error: 2.25 on 17 degrees of freedom*
> *Multiple R-squared: 0.001069,   Adjusted R-squared: -0.05769 *
> *F-statistic: 0.01819 on 1 and 17 DF,  p-value: 0.8943 *
> *
> *
> Any suggestions will be appreciated. Thanks.

?summary.lm

  In particular, see the 'Value' section which describes the components
of the list returned when an lm() object is summarized.  Notice the
r.squared and coefficients components of the returned list.

> Wenjun
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list