how can I retrieve / impute the underlying rotation matrix (rotmat) from psych::principal?

断了今生、忘了曾经 提交于 2019-12-12 02:07:51

问题


I'm using psych::principal in another function, with various rotate functions passed to principal. (principal offers many rotation options and passes them on to different other functions).

I need to get the rotation matrix that whichever rotation procedure was used found, and implemented.

All of the downstream rotation procedures offer this, but it appears not to be return()ed by principal.

For example:

randomcor <- cor(matrix(data = rnorm(n = 100), nrow = 10))
library(psych)
principalres <- principal(r = randomcor, nfactors = 3, rotate = "none")
unrot.loa <- unclass(principalres$loadings)

principalrot <- principal(r = randomcor, nfactors = 3, rotate = "varimax") # there is no way to retrieve the rot.mat from principal

# but this CAN be done from the underlying varimax!
varimaxres <- varimax(x = unrot.loa)
varimaxres$rotmat # see, THIS is what I want!

I am loathe to re-implement all of the rotation procedures from principal. (Don't repeat yourself, or someone else, as the say).

Does anyone have an idea how:

  • I could elegantly, somehow, magically, retrieve rotmat from principal(), though it appears not to return it?
  • I could, alternatively, impute whichever rotmat must have "happened", because I know the rotated and unrotated loadings?

回答1:


as promised by William Revelle, as of 1.5.8, psych also returns the rotation matrices for factor analyses and principal components analysis.

This solves the problem, continuing the above example:

principalrot$rot.mat == varimaxres$rotmat  # it works!


来源:https://stackoverflow.com/questions/32157031/how-can-i-retrieve-impute-the-underlying-rotation-matrix-rotmat-from-psych

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!