[R] Printing correlation matrices (lm/glm)
Liaw, Andy
andy_liaw at merck.com
Fri Dec 20 07:12:03 CET 2002
Try print(summary(lm2, corr=TRUE), symbolic.corr=FALSE). It *is* in the
help page.
HTH,
Andy
> From: Ted.Harding at nessie.mcc.ac.uk
> Subject: [R] Printing correlation matrices (lm/glm)
>
> Hi Folks,
>
> I'm analysing some data which, in its simplest aspect,
> has 3 factors A, B, C each at 2 levels.
>
> If I do
>
> lm1 <- lm(y ~ A*B)
>
> say, and then
>
> summary(lm1, corr=T)
>
> I get the correlation matrix of the estimated coeffcients
> with numerical values for the correlations (3 coeffs in this
> case). Likewise with 'glm' instead of 'lm'.
>
> However, if I do
>
> lm2 <- lm(y ~ A*B*C)
>
> and then
>
> summary(lm2, corr=T)
>
> I get only symbols (such as ".", "+", "*") for the values,
> denoting ranges, and not numbers (7 coefficients in this case).
>
> Presumably this happens when the number of columns is considered
> to be getting a bit large for numbers -- though 7 is not huge ...
>
> Anyway, is there any way I can get the full correlation matrix
> out with numbers instead of symbols, even with several coefficients?
>
> With thanks,
> Ted.
------------------------------------------------------------------------------
More information about the R-help
mailing list