On Feb 5, 2010, at 11:54 AM, Trafim Vanishek wrote:

Dear all,

I would like to ask how to extract the p-value for the whole model from
summary(lm).
This didn't help a lot summary.lm

I disagree. The help page tells you that "coefficients" has the p- values sogo ahead and get them:

> summary.lm(lm(speed~dist, cars))$coefficients
             Estimate Std. Error  t value     Pr(>|t|)
(Intercept) 8.2839056 0.87438449 9.473985 1.440974e-12
dist        0.1655676 0.01749448 9.463990 1.489836e-12

That is a table or matrix (it doesn't really matter for our purposes) and can be address by either numbers or names. Here is how to do it with names.

> summary.lm(lm(speed~dist, cars))$coefficients["dist","Pr(>|t|)"]
[1] 1.489836e-12



summary(lm(speed~dist, cars))

--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to