[R] factanal question
John Fox
jfox at mcmaster.ca
Mon Dec 1 15:30:45 CET 2008
Dear Don,
All long as you leave the factors unrotated or do an orthogonal rotation (as
is the default), you can compute reproduced correlations among the variables
from the factor loadings, and thus residual correlations given the loadings
and the original correlation matrix, both of which are accessible in the
object returned by factanal(); the following isn't carefully tested, but
should work:
repRes <- function(F, round=3){
A <- loadings(F)
R <- F$correlation
RR <- A %*% t(A)
ResR <- R - RR
list(reproduced.correlations=round(RR, round),
residual.correlations=round(ResR, round))
}
Here F is an object returned by factanal(). The diagonal elements of the
reproduced correlations are the communalities, and of the residual
correlations, the uniquenesses.
To do this from an oblique rotation would require the factor-correlation
matrix, which, as has been pointed out previously, factanal() oddly doesn't
provide. In this case, that's not a real impediment, since reproduced and
residual correlations are invariant with respect to rotation of the factors.
I hope this helps,
John
------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of Don McNeil
> Sent: November-30-08 11:39 PM
> To: r-help at r-project.org
> Subject: [R] factanal question
>
> Dear R users:
> I'm wondering if it's possible to get the residual correlation matrix when
> using factanal.
> Since factanal assumes that the errors are normally distributed and
> independent (provided the factor model fits the data) this would be
useful.
> Of course you would need to submit the data to the function to get the
> residuals (not just their correlation matrix), but it should be possible
to
> get the residual correlation matrix if only the data correlation matrix is
> provided.
> Don McNeil
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list