2013-03-31 36 views
0

我有以下代碼:Acessing負載數據之後FA()

> 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" 

如何可以直接訪問loadings無論是作爲4載體,或4x24陣列?

回答

1

問題不明確。 ld屬於loadings。您可以使用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 
........ 

但結果是不一樣的,因爲print.loadings做一些打印格式和矩陣的一個總結。

+0

感謝+1正是我想要的:-) –