Re: [S] (X'X)^(-1) from aov

Christian Hoffmann (
Wed, 01 Jul 1998 15:56:02 +0200

Thanks to Professor Ripley for the prompt answer to my question. For the
solution to work, see the correction stated below.

At 12:36 1998.07.01 +0100, you wrote:
>On Wed, 1 Jul 1998, Christian Hoffmann wrote:
>> Hi there,
>> For a manova, Y = X*B + U, I want to compute the covariances
>> (beta-hat-ij,beta-hat-kl) = sigma-jl*g-ik, with g the elements of G <-
>> (X'X)^(-1), where X is the design matrix. I have the feeling that G is
>> constructed inside method "aov", but somehow I cannot find it. I want to
>> make it appear as a result parameter $G.
>It's computed in summary.lm, so
>summary.lm(object)$cov.unscaled is what you need.
>It is not needed by lm, aov, manova, ....

Thank you for the hint. This will work only after in

coef <- coefficients(object)
cnames <- labels(coef)
rinv <- diag(p)
dimnames(rinv) <- list(cnames, cnames)
is changed to
dimnames(rinv) <- list(cnames[[1]], cnames[[1]])

Obviously cnames has a second component when it has been generated by aov.

May be one should amend summary.lm accordingly.

Thank you again

Christian W. Hoffmann
Swiss Federal Institute for Forest, Snow and Landscape Research
CH-8903 Birmensdorf, Switzerland
phone: ++41-1-739 22 77 fax : ++41-1-739 22 15 e-mail:
I prefer WWW pages which can be viewed best with *any* browser, contain
*no* cookies, *no* Java, *no* frames, and *no* required images !
This message was distributed by To unsubscribe
send e-mail to with the BODY of the
message: unsubscribe s-news