【发布时间】:2015-09-02 11:21:35
【问题描述】:
在related question 中,我询问了为什么stats::varimax 和GPArotation::Varimax 之间存在差异,这两个psych::principal 调用,这取决于为rotate = 设置的选项。
这两者之间的差异(请参阅其他问题)解释了与 psych::principal 的部分差异,但不是全部差异。
似乎psych::principal 以某种方式加剧了这些差异。
(我有一个简单的理论为什么,我想得到证实)。
library(GPArotation)
library(psych)
data("Thurstone")
principal.unrotated <- principal(r = Thurstone, nfactors = 4, rotate = "none") # find unrotated PCs first
loa <- unclass(principal.unrotated$loadings)
# just to compare that the rot.mat is correct
varimax.stats <- stats::varimax(x = loa, normalize = TRUE)
varimax.GPA <- GPArotation::Varimax(L = loa, normalize = TRUE)
# notice we're here NOT interested in the difference between stats and GPA, that's the other question
diff.from.rot.meth <- unclass(varimax.stats$loadings - varimax.GPA$loadings) # very small differences, see this question: https://stackoverflow.com/questions/32350891/why-are-there-differences-between-gparotationvarimax-and-statsvarimax
mean(abs(diff.from.rot.meth))
#> [1] 8.036863e-05
principal.varimax.stats <- principal(r = Thurstone, nfactors = 4, rotate = "varimax")
principal.Varimax.GPA <- principal(r = Thurstone, nfactors = 4, rotate = "Varimax")
diff.from.princ <- principal.Varimax.GPA$rot.mat - principal.varimax.stats$rot.mat # quite a substantial change, because Theta is NOT a rotmat, that makes sense
mean(abs(diff.from.princ))
#> [1] 0.021233
mean(abs(diff.from.rot.meth)) - mean(abs(diff.from.princ)) # principal has MUCH bigger differences
#> [1] -0.02115263
对于浮点伪像或其他东西来说,这似乎太大了。
我的假设是(额外的)差异源于 GPArotation::Varimax 默认为 (Kaiser) normalize == FALSE,而 **stats::varimax 默认为 (Kaiser) normalize == TRUE,不能在 `principal::psych` 中设置不同。
stats::varimax手册:
## varimax with normalize = TRUE is the default
GPArotation::Varimax/GPArotation::GPForth手册:
参数 normalize 指示是否以及如何在旋转之前进行任何规范化,然后在旋转后撤消。如果 normalize 为 FALSE(默认值),则不进行标准化。如果 normalize 为 TRUE,则完成 Kaiser 标准化。 (所以归一化 A 的平方行条目总和为 1.0。这有时称为 Horst 归一化。)
另外,他们psych::Kaiser 手动警告:
GPARotation 包(默认情况下)不规范化,fa 函数也不规范化。然后,为了更容易混淆,stats 中的 varimax 会,GPRotation 中的 Varimax 不会。
任何人都可以确认差异实际上是由标准化选项解释的吗?
【问题讨论】: