| rotations | R Documentation |
Optimize factor loading rotation objective.
oblimin(A, Tmat = NULL, gam=0, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
quartimin(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
targetT(A, Tmat = NULL, Target = NULL, normalize = FALSE, randomStarts = 0,
algorithm = "bb", fwindow = 10, ...)
targetQ(A, Tmat = NULL, Target = NULL, normalize = FALSE, randomStarts = 0,
algorithm = "bb", fwindow = 10, ...)
pstT(A, Tmat = NULL, W = NULL, Target = NULL, normalize = FALSE,
randomStarts = 0, algorithm = "bb", fwindow = 10, ...)
pstQ(A, Tmat = NULL, W = NULL, Target = NULL, normalize = FALSE,
randomStarts = 0, algorithm = "bb", fwindow = 10, ...)
oblimax(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
entropy(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
quartimax(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
Varimax(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
simplimax(A, Tmat = NULL, k=NULL, normalize=FALSE,
randomStarts=0, algorithm = "bb", fwindow = 10,...)
bentlerT(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
bentlerQ(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
tandemI(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
tandemII(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
geominT(A, Tmat = NULL, delta=0.01, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
geominQ(A, Tmat = NULL, delta=0.01, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
bigeominT(A, Tmat = NULL, delta=0.01, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
bigeominQ(A, Tmat = NULL, delta=0.01, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
cfT(A, Tmat = NULL, kappa=0, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
cfQ(A, Tmat = NULL, kappa=0, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
equamax(A, Tmat = NULL, kappa=NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
parsimax(A, Tmat = NULL, kappa=NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
infomaxT(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
infomaxQ(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
mccammon(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
varimin(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
bifactorT(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
bifactorQ(A, Tmat = NULL, normalize=FALSE, randomStarts=0,
algorithm = "bb", fwindow = 10, ...)
lpT(A, Tmat=diag(ncol(A)), p=1, normalize=FALSE, eps=1e-05, maxit=2000,
randomStarts=0, gpaiter=5)
lpQ(A, Tmat=diag(ncol(A)), p=1, normalize=FALSE, eps=1e-05, maxit=2000,
randomStarts=0, gpaiter=5)
A |
an initial loadings matrix to be rotated. |
Tmat |
initial rotation matrix. |
gam |
Obliqueness parameter ( |
Target |
rotation target for objective calculation. |
W |
weighting of each element in target. |
k |
number of close to zero loadings. |
delta |
constant added to |
kappa |
see details. |
normalize |
parameter passed to optimization routine (GPForth or GPFoblq). |
eps |
convergence tolerance passed to |
maxit |
maximum number of iterations passed to |
randomStarts |
parameter passed to optimization routine (GPFRSorth or GPFRSoblq). |
algorithm |
Line-search strategy used to calculate step size alpha. |
fwindow |
integer. Number of previous criterion values used in the non-monotone line search. |
p |
Component-wise |
gpaiter |
Maximum iterations for GPA rotation loop in |
... |
additional arguments passed to |
These functions optimize a rotation objective. They can be used directly or the
function name can be passed to factor analysis functions like factanal.
Several of the function names end in T or Q, which indicates if they are
orthogonal or oblique rotations (using GPFRSorth or GPFRSoblq
respectively). The gradient projection algorithms are described in
Bernaards and Jennrich (2005).
oblimin | oblique | oblimin family; gam controls obliqueness |
quartimin | oblique | oblimin with gam = 0 |
targetT | orthogonal | rotation towards a target matrix |
targetQ | oblique | rotation towards a target matrix |
pstT | orthogonal | partially specified target rotation |
pstQ | oblique | partially specified target rotation |
oblimax | oblique | maximizes overall kurtosis of loadings |
entropy | orthogonal | minimizes entropy of squared loadings |
quartimax | orthogonal | maximizes variance of squared loadings within variables |
Varimax | orthogonal | maximizes variance of squared loadings within factors |
simplimax | oblique | minimizes the k smallest squared loadings |
bentlerT | orthogonal | invariant pattern simplicity |
bentlerQ | oblique | invariant pattern simplicity |
tandemI | orthogonal | factors share high loadings on same variables |
tandemII | orthogonal | factors do not share high loadings on same variables |
geominT | orthogonal | minimizes geometric mean of squared loadings |
geominQ | oblique | minimizes geometric mean of squared loadings |
bigeominT | orthogonal | geomin with a general factor in column 1 |
bigeominQ | oblique | geomin with a general factor in column 1 |
cfT | orthogonal | Crawford-Ferguson family; kappa controls complexity |
cfQ | oblique | Crawford-Ferguson family; kappa controls complexity |
equamax | orthogonal | Crawford-Ferguson with kappa = m/(2p) |
parsimax | orthogonal | Crawford-Ferguson with kappa = (m-1)/(p+m-2) |
infomaxT | orthogonal | infomax information criterion |
infomaxQ | oblique | infomax information criterion |
mccammon | orthogonal | minimizes entropy ratio across factors |
varimin | orthogonal | minimizes variance of squared loadings within factors |
bifactorT | orthogonal | bifactor; general factor in column 1 |
bifactorQ | oblique | biquartimin; general factor in column 1 |
lpT | orthogonal | L^p sparsity rotation |
lpQ | oblique | L^p sparsity rotation |
The Varimax implementation in the list uses the gradient projection algorithm
applied to vgQ.varimax. This implementation is different that the
varimax rotation defined in the stats package. Additionally,
varimax does Kaiser normalization by default whereas
GPArotation::Varimax does not.
The argument kappa parameterizes the family for the Crawford-Ferguson
method. If m is the number of factors and p is the number of
indicators then kappa values having special names are 0=Quartimax,
1/p=Varimax, m/(2*p)=Equamax,
(m-1)/(p+m-2)=Parsimax, 1=Factor parsimony.
Bifactor rotations, bifactorT and bifactorQ are called bifactor and biquartimin in Jennrich and Bentler (2011). For a comparison of exploratory bifactor analysis algorithms including those implemented here, see Garcia-Garzon, Abad and Garrido (2021).
The argument p is needed for L^p rotation. See
Lp rotation for details on the rotation method.
update follows standard R convention — use it to modify arguments
(e.g. randomStarts, normalize) not to change the rotation
criterion. To re-rotate with a different criterion, use
GPFRSorth or GPFRSoblq with attr(object, "A_unrotated").
A GPArotation object which is a list with elements:
loadings |
The rotated loadings matrix, one column per factor. If random starts were requested, this is the solution with the lowest criterion value. |
Th |
The rotation matrix, satisfying
|
Table |
A matrix recording the iteration history: iteration number, criterion value, log10 of the gradient norm, and step size (alpha). |
method |
A string indicating the rotation criterion. |
orthogonal |
A logical indicating if the rotation is orthogonal. |
convergence |
A logical indicating if convergence was obtained. |
Phi |
|
Gq |
The gradient of the criterion at the rotated loadings. |
randStartChar |
A named vector summarising random start results:
|
Coen A. Bernaards and Robert I. Jennrich with some R modifications by Paul Gilbert.
Bernaards, C.A. and Jennrich, R.I. (2005) Gradient Projection Algorithms and Software for Arbitrary Rotation Criteria in Factor Analysis. Educational and Psychological Measurement, 65, 676–696. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1177/0013164404272507")}
Bi, Y. and Barchard, K.A. (2024). Purchasing choices that reduce climate change: An exploratory factor analysis. Spectra Undergraduate Research Journal, 3(2), 8–14. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.9741/2766-7227.1028")}
Fischer, R., & Fontaine, J. (2010). Methods for investigating structural equivalence. In D. Matsumoto & F. van de Vijver (Eds.), Cross-Cultural Research Methods in Psychology (pp. 179–215). Cambridge University Press. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/CBO9780511779381.010")}
Garcia-Garzon, E., Abad, F.J. and Garrido, L.E. (2021). On omega hierarchical estimation: A comparison of exploratory bi-factor analysis algorithms. Multivariate Behavioral Research, 56(1), 101–119. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2020.1736977")}
Jennrich, R.I. and Bentler, P.M. (2011). Exploratory bi-factor analysis. Psychometrika, 76(4), 537–549. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11336-011-9218-4")}
For references to individual rotation criteria see
vignette("GPA1guide", package = "GPArotation").
factanal,
GPFRSorth,
GPFRSoblq,
vgQ,
Harman8,
NetherlandsTV,
CCAI,
box26
# For extended examples see the vignettes:
# vignette("GPA1guide", package = "GPArotation")
# vignette("GPA2local", package = "GPArotation")
# vignette("GPA3bifactor", package = "GPArotation")
# --- Accessing rotated loadings ---
data("Harman", package = "GPArotation") # 8 physical variables
qHarman <- quartimax(Harman8)
loadings(qHarman) # via extractor (recommended)
qHarman$loadings # via direct list access
all.equal(loadings(qHarman), qHarman$loadings) # identical
# --- Rotating factanal loadings ---
data("WansbeekMeijer", package = "GPArotation") # Netherlands TV viewership
fa.unrotated <- factanal(factors = 2, covmat = NetherlandsTV,
normalize = TRUE, rotation = "none")
quartimax(fa.unrotated, normalize = TRUE)
geominQ(fa.unrotated, normalize = TRUE, randomStarts = 100)
# --- Passing rotation to factanal ---
# CCAI:Climate-Friendly Purchasing Choices domain of the Climate Change Action Inventory
data("CCAI", package = "GPArotation")
factanal(factors = 3, covmat = CCAI_R, n.obs = 461, rotation = "infomaxT")
factanal(factors = 3, covmat = CCAI_R, n.obs = 461, rotation = "infomaxT",
control = list(rotate = list(normalize = TRUE, eps = 1e-6)))
# --- Target rotation ---
# Orthogonal target rotation of two varimax rotated matrices
# towards each other. Data from Fischer and Fontaine (2010).
# See vignette("GPA1guide", package = "GPArotation") for further analyses.
trBritain <- matrix(c(.783, -.163, .811, .202, .724, .209, .850, .064,
-.031, .592, -.028, .723, .388, .434, .141, .808,
.215, .709), byrow = TRUE, ncol = 2)
trGermany <- matrix(c(.778, -.066, .875, .081, .751, .079, .739, .092,
.195, .574, -.030, .807, -.135, .717, .125, .738,
.060, .691), byrow = TRUE, ncol = 2)
trx <- targetT(trGermany, Target = trBritain)
print(trx$loadings - trBritain, cutoff = 0, digits = 3) # difference from target
# Plot discrepancy from target --- steelblue = below target, firebrick = above
plot(trx, type = "target", Target = trBritain)
# --- Partially specified target rotation ---
# See vignette("GPA1guide", package = "GPArotation") for full context.
# Unrotated loadings matrix A and partially specified target SPA.
# NA entries in SPA are unspecified --- rotation is free there.
# Numeric entries are the target values the rotation aims towards.
A <- matrix(c(.664, .688, .492, .837, .705, .82, .661, .457, .765, .322,
.248, .304, -0.291, -0.314, -0.377, .397, .294, .428,
-0.075, .192, .224, .037, .155, -.104, .077, -.488, .009), ncol = 3)
SPA <- matrix(c(rep(NA, 6), .7, .0, .7, rep(0, 3), rep(NA, 7),
0, 0, NA, 0, rep(NA, 4)), ncol = 3)
comparison <- cbind(round(A, 3), rep(NA, nrow(A)), SPA)
colnames(comparison) <- c("A.F1", "A.F2", "A.F3", "|", "T.F1", "T.F2", "T.F3")
cat("Unrotated loadings (A) and partially specified target (SPA):\n")
print(comparison, na.print = "NA")
res.t <- targetT(A, Target = SPA)
print(res.t)
# Discrepancy from target --- specified elements only
plot(res.t, type = "target", Target = SPA)
# --- Random starts and Update calls ---
# CCAI Climate-Friendly Purchasing Choices domain, 14 items, 3 oblique factors.
# High factor intercorrelations make oblimin the natural choice.
# Note: factanal uses MLE extraction; results differ somewhat from
# PCA-based extraction used in Bi and Barchard (2024).
data("CCAI", package = "GPArotation")
fa.unrotated <- factanal(factors = 3, covmat = CCAI_R, n.obs = 461, rotation = "none")
# Single random start via Tmat
res.o <- oblimin(fa.unrotated, Tmat = Random.Start(3))
res.o <- oblimin(fa.unrotated, randomStarts = 1) # equivalent using randomStarts = 1
res.o <- oblimin(fa.unrotated, randomStarts = 100) # multiple random starts
# Update arguments without re-specifying the full call
res.o2 <- update(res.o, randomStarts = 250) # randomStarts = 250
res.o3 <- update(res.o, gam = -0.5) # gam = -0.5, randomStarts = 100
res.o4 <- update(res.o, normalize = TRUE) # normalize = TRUE, randomStarts = 100
# To change rotation criterion, use A_unrotated directly
A <- attr(res.o, "A_unrotated")
res.qt <- GPFRSoblq(A, method = "quartimin")
# Directly via factanal call
factanal(factors = 3, covmat = CCAI_R, n.obs = 461, rotation = "oblimin",
control = list(rotate = list(normalize = TRUE, gam = -0.1, randomStarts = 100)))
# --- Assessing local minima ---
# For detailed investigation of local minima across all random starts
# see vignette("GPA2local", package = "GPArotation").
data(Thurstone, package = "GPArotation")
infomaxQ(box26, normalize = TRUE, randomStarts = 150)
geominQ(box26, normalize = TRUE, randomStarts = 150)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.