Skip to content

correlation predictors problem

3 messages · Robert Espesser -- CNRS, Brian Ripley, Peter Dalgaard

#
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:
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 


I used binaries  rpm from  CRAN .
The same error is obtained with R1.2  on RH6.2 
and R.1.3.1-1 on RH7.0 (with the updated glibc2.2).
A similar  error is obtained with lm.

Thank you
#
On Tue, 11 Sep 2001, Robert Espesser -- CNRS wrote:

            
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).
#
Robert Espesser -- CNRS <Robert.Espesser at lpl.univ-aix.fr> writes:
....
Um, wrong in what way? 

If you just think this looks weird, blame Martin who wrote the code
for displaying correlation matrices like this. See the help for
symnum() for what it means. You can turn this off by passing
symbolic.cor=FALSE to print.summary.lm.

If the actual correlations are wrong, you need to tell us why you
think so.