[R] How to get the P-values from GLM results?

Bill.Venables at csiro.au Bill.Venables at csiro.au
Wed Mar 19 08:43:17 CET 2008


Why use glm(...) for a multiple regression?  A multiple regression model
is just an LM, not a GLM.  glm(...) is the long way round, at best.

___

fm <- lm(y ~ x1+x2+..., data = myData)  ## fits the model
summary(fm)            ## will show you the tests, including p-values

pv <- summary(fm)$coef[, "Pr(>|t|)"]  ## will extract them



-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Alex Wang
Sent: Wednesday, 19 March 2008 1:51 PM
To: r-help at r-project.org
Subject: [R] How to get the P-values from GLM results?

Hello all,

  I have a question concerning how to get the P-value for a explanatory
variables based on GLM.

 I'll run multiple regressions with GLM, and I'll need the P-value for
the
same explanatory variable from these multiple GLM results.

 I check the help and there are quite a few Value options but I just
can
not find anyone  about the p-value.

 Could anyone help me with that?

Thanks a lot!

Alex

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