[R] Extract p-value from lm for the whole model

Turchin, Michael Michael.Turchin at childrens.harvard.edu
Fri Feb 5 18:00:39 CET 2010

You should be able to access the p-value using the $coefficients variable, which is part of summary.


results <- summary(lm(speed~dist, cars))

and then:


where x is the location of particular p-value, or coefficient supplied, you want, from the results$coefficient vector.

Hope this helps,
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Trafim Vanishek [rdapamoga at gmail.com]
Sent: Friday, February 05, 2010 11:54 AM
To: r-help at r-project.org
Subject: [R] Extract p-value from lm for the whole model

Dear all,

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

summary(lm(speed~dist, cars))

Thanks a lot!

        [[alternative HTML version deleted]]

R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list