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 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 -- Robert Espesser Laboratoire Parole et Langage ESA 6057, CNRS 29 Av. Robert Schuman 13621 AIX (FRANCE) Tel: +33 (0)4 42 95 36 26 Fax: +33 (0)4 42 59 50 96 http://www.lpl.univ-aix.fr/~espesser mailto:Robert.Espesser at lpl.univ-aix.fr -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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' 1Notice 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Robert Espesser -- CNRS <Robert.Espesser at lpl.univ-aix.fr> writes:> 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:....> 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' 1Um, 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. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Reasonably Related Threads
- search contrasts tutorial
- anova repeated measure interpretation
- aov for mixed model (fixed and random)?
- Re: Help? Running into problems with migrateToURI2() and virDomainDefCheckABIStability()
- Samba4 - Corrupted group caused stop of replication - "Object class violation"