2
我正在使用以下代码使用mtcars数据和factanal函数进行因子分析。配合$负荷的打印给比例变化,但它似乎并没有在那里的STR(FIT $载荷):R中神秘的输出源?
> fit <- factanal(mtcars, 3, rotation="varimax")
> fit$loadings
Loadings:
Factor1 Factor2 Factor3
mpg 0.643 -0.478 -0.473
cyl -0.618 0.703 0.261
disp -0.719 0.537 0.323
hp -0.291 0.725 0.513
drat 0.804 -0.241
wt -0.778 0.248 0.524
qsec -0.177 -0.946 -0.151
vs 0.295 -0.805 -0.204
am 0.880
gear 0.908 0.224
carb 0.114 0.559 0.719
Factor1 Factor2 Factor3
SS loadings 4.380 3.520 1.578
Proportion Var 0.398 0.320 0.143 <<<<<<<<<<<<< I NEED THESE NUMBERS AS A VECTOR
Cumulative Var 0.398 0.718 0.862
>
> str(fit$loadings)
loadings [1:11, 1:3] 0.643 -0.618 -0.719 -0.291 0.804 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:11] "mpg" "cyl" "disp" "hp" ...
..$ : chr [1:3] "Factor1" "Factor2" "Factor3"
我怎样才能得到合适的负荷$比例变差矢量?谢谢你的帮助。
即将发布相同的答案。另一个获得源代码的方法是'getAnywhere(print.loadings)'。 – tonytonov 2015-04-03 15:27:59
这正是我所需要的。谢谢。 – rnso 2015-04-03 15:55:11