MultivariateStats.jl icon indicating copy to clipboard operation
MultivariateStats.jl copied to clipboard

Varimax rotation in Factor Analysis?

Open BoundaryValueProblems opened this issue 5 years ago • 5 comments

I'm wondering whether there's any plan to implement the so-called Varimax Rotation and other rotations of factors or PCA loadings as MATLAB's rotatefactors function in Statistics Toolbox. Thanks! BVP

BoundaryValueProblems avatar Jul 29 '18 00:07 BoundaryValueProblems

http://www.stat.ucla.edu/research/gpa/references.pdf

wildart avatar Sep 27 '18 23:09 wildart

I'd be up for giving this a try as I just happened to need an implementation of factor rotations as well. The link that @wildart posted seems to be dead but I found this http://www2.imm.dtu.dk/pubdb/edoc/imm4041.pdf regarding orthomax rotations (it's linked on Wikipedia). It's basically the same algorithm that R performs, albeit the R team limit themselves to varimax rotations. It seems though that by simply adding the parameter gamma it is possible to use the same algorithm for quartimax, equamax, and parsimax rotations as well. Then there is promax which is also implemented in stats::promax in R. Seems to be some sort of linear model fit but haven't found a good source yet.

In R a lot of rotations are implemented in the GPArotation package (main source: Bernaards CA, Jennrich RI. Gradient Projection Algorithms and Software for Arbitrary Rotation Criteria in Factor Analysis. Educational and Psychological Measurement. 2005;65(5):676-696. doi:10.1177/0013164404272507) and the psych package (https://www.rdocumentation.org/packages/psych/versions/2.0.8/topics/Promax) which I could draw inspiration from.

The MATLAB function and the psych package also support oblique rotations (procrustes and pattern/target) and not just orthogonal rotations. Is this something that should be included as well?

Given that there are so many different rotations, I am wondering if it is preferable to have a 'catch-all' interface like rotatefactors or if the R style is preferred where each rotation has its own function call.

Are there any guidelines for contribution? I couldn't find any on the repository. I'm fairly new to Julia so please excuse my uncertainty.

cyianor avatar Oct 13 '20 08:10 cyianor

Hi @Cyianor, I transformed the factor rotations code from MATLAB to Julia for my research purposes. Please see varimax.jl. I would also like to contribute to MultivariateStats.jl. So please feel free to modify and improve my codes.

haotian127 avatar Oct 13 '20 17:10 haotian127

Thanks @haotian127! This looks very similar to what R does in its varimax function but with an extra warmup step in the beginning. I guess its reasonable to have a separate function for the orthomax rotations and then maybe later add additional functions that address other rotations like non-oblique rotations with the help of the ideas in Bernaards and Jennrich (2005). I'll try and put together a pull request in the next few days then we can shift the discussion there.

cyianor avatar Oct 14 '20 06:10 cyianor

I found some implementation on GitHub while ago. These may come handy during the testing.

https://github.com/EducationalTestingService/factor_analyzer/blob/master/factor_analyzer/rotator.py https://github.com/mvds314/factor_rotation

wildart avatar Oct 14 '20 20:10 wildart