varimax vs. oblimin in PCA?

1,078 views
Skip to first unread message

gabe.ch...@gmail.com

unread,
Feb 10, 2016, 3:54:45 AM2/10/16
to FactoMineR users
Dear FactoMineR users, 

I know various packages (i.e., psych) deal with various rotation alternatives (i.e., varimax, promax, oblimin etc.), though I haven't been able to find similar alternatives in FactoMineR's PCA function, are there any? 

(Ultimately, I'd like to use FactoMineR visualization tools -i.e., including the very useful supplementary variables - to visually compare the bi-plots of varimax vs. oblimin rotated spaces.)

Thanks a lot for any input!

Best, 
Gabe

josse

unread,
Feb 12, 2016, 3:28:07 AM2/12/16
to factomin...@googlegroups.com


Le 10/02/2016 09:54, gabe.ch...@gmail.com a écrit :
Dear FactoMineR users, 

I know various packages (i.e., psych) deal with various rotation alternatives (i.e., varimax, promax, oblimin etc.), though I haven't been able to find similar alternatives in FactoMineR's PCA function, are there any?
No that's right, rotations are not implemented in FactoMineR


(Ultimately, I'd like to use FactoMineR visualization tools -i.e., including the very useful supplementary variables - to visually compare the bi-plots of varimax vs. oblimin rotated spaces.)
But, you can use the function ?varimax.
You have to think what you would like to rotates, if it is the loadings (variables coordinates scaled to 1), you should first find the loadings:
The loadings in FactoMineR are in:
loadings.pca= sweep(res.pca$var$coord,2,sqrt(res.pca$eig[1:ncol(res.pca$var$coord),1]),FUN="/")

Then, rotate them:
loadings.pcarot= varimax(loadings.pca)$loadings


You should then represent the results with FactoMiner using this small trick:
res.pca$var$coord = loadings.pcarot
plot(res.pca, choix  ="var")


Best,
Julie

Thanks a lot for any input!

Best, 
Gabe
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "FactoMineR users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse factominer-use...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

-- 
juliejosse.com

gabe.ch...@gmail.com

unread,
Sep 15, 2016, 7:32:15 AM9/15/16
to FactoMineR users
Dear Julie Josse, 

With some delay, thank you very much for your helpful answer. 

If you ever find the time, could I follow up with 2 related questions? 

1) I noticed that the (varimax rotated) loadings computed as you suggest differ from those computed by the "principal" function (psych). 

I also noticed that, if I directly perform varimax on the res.pca$var$coord (thus skipping the following line you suggested: loadings.pca= sweep(res.pca$var$coord,2,sqrt(res.pca$eig[1:ncol(res.pca$var$coord),1]),FUN="/"). Then loading values do coincide with those provided by principal from psych. 

Here is a working example:
# As you suggested:
pca.res=PCA(iris[,-5], ncp=2, graph=F)
loadings.pca= sweep(pca.res$var$coord,2,sqrt(pca.res$eig[1:ncol(pca.res$var$coord),1]),FUN="/")
loadings.pcarot= varimax(loadings.pca)$loadings
pca.res$var$coord = loadings.pcarot
principal.res=principal(iris[,-5], nfactors=2, rotate="varimax")
cbind(principal.res$loadings, pca.res$var$coord)
# The 2 loadings differ. 


pca.res=PCA(iris[,-5], ncp=2, graph=F)
# loadings.pca= sweep(pca.res$var$coord,2,sqrt(pca.res$eig[1:ncol(pca.res$var$coord),1]),FUN="/") # Now skipping this line of code: 
loadings.pcarot= varimax(pca.res$var$coord)$loadings
# In the line above, instead of running varimax on the loadings, I run it
# directly on the variable coordinates
pca.res$var$coord = loadings.pcarot
cbind(principal.res$loadings, pca.res$var$coord)
# Now they are nearly identical. 

Do you know why this may be? Is this perhaps a terminological issue? 

2) I'm guessing that, if we've now rotated the PCs, individual scores should change accordingly. Is this not the case? If so, since we've replaced res.pca$var$coord with the rotated loadings, wouldn't we have to do the same for res.pca$ind$coord in order to produce a biplot of rotated components? Could you kindly provide a line that specifies what res.pca$ind$coord should be replaced with? In short, res.pca$ind$coord=?

Ultimately, I'd like to produce a res.pca$ind$coord that is as close as possible to principal$scores, so I can then use the factominer biplot packages (which as I mentioned, I think are super useful!)

Thanks again for any tips.

Best, 
Gabe

Thusitha Chandrapala

unread,
Dec 26, 2017, 1:53:50 AM12/26/17
to FactoMineR users
Would love to get the replies for these. 

For 2) I guess it might be worthwhile to investigate if the predict function is used again for the original dataset after replacing the rotated loadings, it might work? Or else one might have to manually calculate the new coefficients. 

Thanks,
Thusitha
Reply all
Reply to author
Forward
0 new messages