简体   繁体   English

fa()之后访问加载数据

[英]Acessing loadings data after fa()

I have the following code: 我有以下代码:

> require(psych)
> require(MASS)
> pa <- fa(Harman74.cor$cov,4,fm="pa" ,rotate="none")
> ld <- loadings(pa)

> str(ld)

loadings [1:24, 1:4] 0.598 0.372 0.42 0.484 0.688 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:24] "VisualPerception" "Cubes" "PaperFormBoard" "Flags" ...
  ..$ : chr [1:4] "PA1" "PA2" "PA3" "PA4"

How can I directly access the loadings either as 4 vectors, or a 4x24 array ? 如何直接以4个向量或4x24数组访问loadings

The question is not clear. 问题尚不清楚。 ld is of class loadings . ld是类loadings You can use unclass to convert it to a matrix . 您可以使用unclass将其转换为matrix

unclass(ld)
                             PA1         PA2          PA3          PA4
VisualPerception       0.5982838  0.02973076  0.379881903 -0.216752604
Cubes                  0.3721564 -0.03009154  0.261549017 -0.148551734
PaperFormBoard         0.4195414 -0.11770506  0.364650207 -0.125225346
Flags                  0.4840396 -0.10757757  0.260532547 -0.190122114
GeneralInformation     0.6880672 -0.29797186 -0.274215767 -0.037571574
........

But the result is not the same since the print.loadings do some formattings and a summary of the matrix. 但是结果是不一样的,因为print.loadings做一些格式化和矩阵汇总。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM