如何从psych :: principal检索/估算底层旋转矩阵(rotmat)? [英] how can I retrieve / impute the underlying rotation matrix (rotmat) from psych::principal?

查看:158
本文介绍了如何从psych :: principal检索/估算底层旋转矩阵(rotmat)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在另一个函数中使用了psych::principal,并将各种rotate函数传递给了principal. (principal提供许多旋转选项,并将它们传递给其他不同的函数).

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.

所有下游轮换程序都提供了此功能,但principal似乎没有对它进行return().

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

例如:

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!

我不愿重新执行principal中的所有轮换程序. (俗话说,不要重复自己或别人).

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

有人知道如何:

  • 我可以优雅地以某种方式神奇地从principal()检索 rotmat,尽管看起来好像不返回它?
  • 或者,我可以归因哪个rotmat必须发生",因为我知道旋转未旋转的负载?
  • 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?

推荐答案

,正如William Revelle所承诺的那样,从1.5.8开始,psych还返回旋转矩阵以进行因子分析和主成分分析.

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!

这篇关于如何从psych :: principal检索/估算底层旋转矩阵(rotmat)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆