[R] correlation predictors problem
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Sep 11 10:02:31 CEST 2001
On Tue, 11 Sep 2001, Robert Espesser -- CNRS wrote:
> R colleagues,
>
> I want
> to get the correlation between the coefficients of a regression.
> Everything seems OK, but when there are more than 3 regressors, the
> correlation matrix is completely wrong, as follows:
>
> > x.glm <- glm( bascule ~durP+ durI +durC+moyHzPB +moyHzIN, x,family=binomial)
> > summary(x.glm,correlation=T)
>
> Call:
> glm(formula = bascule ~ durP + durI + durC + moyHzPB + moyHzIN,
> family = binomial, data = x)
> .......
> ........
> (Dispersion parameter for binomial family taken to be 1)
>
> Null deviance: 365.00 on 266 degrees of freedom
> Residual deviance: 305.72 on 261 degrees of freedom
> AIC: 317.72
>
> Number of Fisher Scoring iterations: 3
>
> Correlation of Coefficients:
> ( dP dI dC mHP
> durP 1
> durI 1
> durC 1
> moyHzPB . 1
> moyHzIN ,
> attr(,"legend")
> [1] 0 ` ' 0.3 `.' 0.6 `,' 0.8 `+' 0.9 `*' 0.95 `B' 1
Notice the legend. You don't have the correlation matrix but a
representation of it.
This is one of those things that certain people are keen on, and so
make the default for others.
You want
print(summary(x.glm,correlation=TRUE), symbolic.cor = FALSE)
I do think there should be a global option to turn this on, it being off
by default. It's not even a documented argument in current R (but will be
in 1.4.0).
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list