【发布时间】:2014-04-07 23:48:08
【问题描述】:
在主成分分析之后,我试图让我的原始相关矩阵的变量以与(排序的)载荷矩阵相同的方式排序(如 print.psych 所示)。我使用了 psych 包中的以下函数,但我无法让两者对齐。
pc <- principal(myCorrMatrix$correlations, nfactors=15, n.obs=49, rotate="oblimin")
print.psych(pc, cut=0.3, sort=TRUE)
sortedPC <- fa.sort(pc)
sortedMatrix <- mat.sort(myCorrMatrix$correlations, sortedPC)
我不是 100% 确定 mat.sort 的第二个参数应该是什么,但我尝试了 sortedPC 的几个元素都无济于事。任何指针将不胜感激!
【问题讨论】:
-
最好是
dput和myCorrMatrix$correlations,因为您使用的所有命令都特定于psych包。见:stackoverflow.com/questions/5963269/… -
@rmk:我知道这会让事情变得更容易,但我不想分享数据......
标签: r sorting matrix principal psych