I have to perform a factor analysis. My data is a questionnaire with same answers possible for each question, so no scale problem.
I tried to use factanal()
from base R and fa()
from the psych
package.
Even with having Maximum likelihood set for both methods, using the “promax” rotation gives different factor loadings.
The question has already been asked there : /questions/50573764/differences-between-fa-and-factanal-functions-in-r#:~:text=factanal%20performs%20a%20maximum%2Dlikelihood,least%20square%20regressions%20(OLR).
but the answer is not completely true, the article they link to say “same results” but it is same results only when we use “varimax” rotation.
So i wonder why there is a difference in factor loadings, and how to know which of both methods could be the best (psych
package offers more things, but why is it different when it is supposed to be the same?)
This is a reproducible example:
# Load the psych package for
# data analysis and visualization
library(psych)
library(GPArotation)
# Load the mtcars dataset
data(mtcars)
# Perform factor analysis on the mtcars dataset
factanal <- factanal(mtcars, factors=3, rotation="promax")
fa <- fa(mtcars, nfactors = 3, fm="ml", rotate="promax")
# Print the results
head(round(factanal$loadings, 2))
Factor1 Factor2 Factor3
mpg 0.54 0.16 -0.43
cyl -0.53 -0.58 0.08
disp -0.65 -0.32 0.19
hp -0.11 -0.48 0.47
drat 0.83 0.12 0.10
wt -0.71 0.18 0.54
head(round(fa$loadings, 2))
ML2 ML1 ML3
mpg 0.52 0.17 -0.43
cyl -0.51 -0.59 0.08
disp -0.63 -0.33 0.19
hp -0.09 -0.49 0.48
drat 0.83 0.13 0.10
wt -0.70 0.16 0.54
In R documentation, as mentionned in first comment, they recommend to use “oblique.Scores=TRUE”, but that does not change the factor loadings:
fa2 <- fa(mtcars, nfactors = 3, fm="ml", rotate="promax", oblique.scores=T, scores="tenBerge")
head(round(fa2$loadings, 2))
ML2 ML1 ML3
mpg 0.52 0.17 -0.43
cyl -0.51 -0.59 0.08
disp -0.63 -0.33 0.19
hp -0.09 -0.49 0.48
drat 0.83 0.13 0.10
wt -0.70 0.16 0.54