Search code examples
ranalysis

How does factanal() function in R calculate correlations between factors?


When using the factanal() function from the stats package in R using the promax rotation, you are given factor correlations.

tmp = cbind(rnorm(200,2,1.5),rnorm(200,2,1.5),rnorm(200,2,1.5),rnorm(200,2,1.5),rnorm(200,2,1.5),rnorm(200,2,1.5))
print(factanal(tmp, 3, rotation="promax"))

However, I can not seem to find how these correlations are calculated (no help in the R documentation). I also fail to recreate them myself using cor() on the factor scores.

I'm guessing it may be a polychoric correlation, but I can't be certain.


Solution

  • Its calculated using the following code which can be found here https://github.com/SurajGupta/r-source/blob/master/src/library/stats/R/factanal.R:

    tmat <- solve(tmp$rotmat) R <- tmat %*% t(tmat)