[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.

Try:

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

and then:

results$coefficients[x]

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

Hope this helps,
~Michael
________________________________________
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
summary(lm).
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
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.



More information about the R-help mailing list