问题
There are (at least) two different ways to varimax-rotate a loadings matrix in R, GPArotation::Varimax
and stats::varimax
.
Oddly, even if the Kaiser-Normalization is enabled for both, they yield subtly different results.
That's a bit of a pain for testing.
library(GPArotation)
library(psych)
data("Thurstone")
principal.unrotated <- principal(r = Thurstone, nfactors = 4, rotate = "none") # find unrotated PCs first
loa <- unclass(principal.unrotated$loadings)
varimax.stats <- stats::varimax(x = loa, normalize = TRUE)
varimax.GPA <- GPArotation::Varimax(L = loa, normalize = TRUE)
unclass(varimax.stats$loadings) - unclass(varimax.GPA$loadings) # small differences
#> PC1 PC2 PC3 PC4
#> Sentences -6.158219e-05 1.978395e-05 2.507685e-04 -1.901896e-06
#> Vocabulary -5.381439e-05 2.066220e-05 2.507735e-04 8.781259e-06
#> Sent.Completion -5.209981e-05 2.127085e-05 2.469213e-04 4.052756e-06
#> First.Letters -1.096117e-04 -1.206990e-06 1.043846e-04 3.892283e-05
#> 4.Letter.Words -1.272682e-04 -6.622974e-06 9.323033e-05 2.852347e-05
#> Suffixes -3.135108e-05 -7.443932e-06 1.258813e-04 6.922436e-05
#> Letter.Series -1.960431e-04 -5.694846e-05 1.031590e-04 -5.951437e-05
#> Pedigrees -8.587490e-05 -6.325140e-05 1.779604e-04 -1.750454e-05
#> Letter.Group -2.335317e-04 -3.802961e-05 6.190849e-05 -6.346030e-05
varimax.stats$rotmat - varimax.GPA$Th # small differences
#> [,1] [,2] [,3] [,4]
#> [1,] -1.380279e-04 -1.380042e-05 2.214319e-04 2.279170e-06
#> [2,] -9.631517e-05 -2.391296e-05 -1.531723e-04 3.371868e-05
#> [3,] -1.758299e-04 -7.917460e-05 -6.788867e-05 -1.099072e-04
#> [4,] 9.548010e-05 -6.500162e-05 1.679753e-05 5.213475e-05
Granted, those differences are not huge – but they seem to be too large to be just floating point artefacts.
I thought varimax was a well-defined automatic rotation that should yield precisely the same result.
Are these differences expected behavior?
How can they be explained?
Notice that normalize = TRUE
is set for both, and so the (absence of) Kaiser normalization does not account for the differences (thought it accounts for those from within psych::principal).
来源:https://stackoverflow.com/questions/32350891/why-are-there-differences-between-gparotationvarimax-and-statsvarimax