Page 1 of 1

Trying to replicate EFA in R

Posted: Sun Dec 05, 2021 8:59 pm
by hjin
I'm basically trying to get at what's under the hood of the jamovi EFA command by seeing if I can replicate it with the psych R package, which I read was what's being run with the jamovi EFA wrapper.

Basically, I managed to write the following:

Code: Select all

efa = fa(data,
         fm = "minres",
         nfactors = fa.parallel(data, fm = "minres")$nfact,
         rotate = "oblimin")
efasort = fa.sort(efa)$loadings
print(efasort, cutoff = 0.3)
Which spits out a similar output as jamovi's EFA with Extraction = "Minimum residuals", Rotation = "Oblimin", Number of Factors = "Based on parallel analysis", and Sort loadings by size = TRUE settings.

However, what's being given in R with the psych package is ever so slightly different from what jamovi (both the app and jmvcore on R) is giving me. Usually, the two results' item loadings would be off by around 0.005 to 0.030.

Is there an option that I'm missing in the psych fa function that's causing the differences?

Re: Trying to replicate EFA in R

Posted: Mon Dec 06, 2021 10:40 pm
by jonathon
take a look in this file:

https://github.com/jamovi/jmv/blob/master/R/pca.b.R

and search for psych::fa , there's 3 references to it

that may give you some clues as to what jamovi is doing differently.

cheers