Skip to content

factanal question

5 messages · Don McNeil, John Fox, William Revelle

#
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
#
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
On
useful.
to
http://www.R-project.org/posting-guide.html
#
Don and John,
   factor.residuals in the psych package does what you want (and 
basically what  John wrote).

Bill
At 9:30 AM -0500 12/1/08, John Fox wrote:

  
    
  
#
Dear Bill,

Thanks for pointing out that this functionality is already in the psych
package. Shouldn't factor.residuals() avoid this computation for oblique
rotations?

Regards,
 John

------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
On
(as
variables
loadings
doesn't
factors.
[mailto:r-help-bounces at r-project.org]
possible
matrix
http://www.R-project.org/posting-guide.html
http://personality-project.org/personality.html
http://www.wcas.northwestern.edu/psych/
http://www.R-project.org/posting-guide.html
1 day later
#
At 11:04 AM -0500 12/1/08, John Fox wrote:
John,
Good suggestion.  I will add that in the next revision.

Bill