HS9 <- HolzingerSwineford1939[paste0("x", 1:9)]15 Rotation, EFA and ESEM
15.1 From confirmatory to exploratory
Up to this point, every model in this book was confirmatory: the user decides in advance which indicators load on which factors, and all other factor loadings are fixed to zero. In many applications, however, no such loading pattern is available, or the zero-loading restrictions of a confirmatory model are too strict. Exploratory factor analysis (EFA) drops the pattern hypothesis altogether: every indicator is allowed to load on every factor, and the analysis itself should reveal which loadings matter. The consequence of this freedom is rotational indeterminacy: without further restrictions, infinitely many loading matrices reproduce the data equally well, and an additional criterion, the rotation criterion, is needed to single out an interpretable solution.
Historically, EFA and SEM developed as separate traditions with separate software. Yet an exploratory factor model is a structural equation model with an unrestricted loading matrix, and once it is treated that way, everything in the preceding chapters (estimators, missing data handling, categorical data, robust standard errors and test statistics, fit measures) becomes available for EFA as well. Moreover, exploratory and confirmatory parts can be freely combined within a single model, an approach known as exploratory structural equation modeling (ESEM) (Asparouhov & Muthén, 2009; Marsh et al., 2014). lavaan implements EFA and ESEM through this route: the efa() function is a thin wrapper around sem(), and the efa("block")* modifier in the model syntax (introduced in Section 2.3.7) marks any set of factors as an exploratory block inside an otherwise ordinary model.
This chapter documents the full pipeline. We first define the unrestricted factor model and the echelon pattern that lavaan uses to identify the unrotated solution (Section 15.2). We then discuss how the unrotated solution is estimated (Section 15.3), catalog the rotation criteria (Section 15.4), and describe the gradient projection and pairwise rotation algorithms together with all the rotation options (Section 15.5). Standard errors for the rotated parameters require special care; Section 15.6 derives the two approaches. The user-facing efa() function and its output are covered in Section 15.7, followed by ESEM: syntax and a worked example (Section 15.8). The chapter closes with the three perspectives on rotation in multiple groups, including the multigroup factor rotation and the alignment method (Section 15.9). Throughout, the running example is once again the Holzinger–Swineford dataset, using the nine indicators of the familiar three-factor model:
15.2 The exploratory factor model
The common factor model for a P-dimensional vector of centered observed variables \mathbf{y} with M common factors \boldsymbol{\eta} is
\mathbf{y}= \boldsymbol{\Lambda}\boldsymbol{\eta}+ \boldsymbol{\epsilon}, \qquad \boldsymbol{\Sigma}(\boldsymbol{\vartheta})= \boldsymbol{\Lambda}\boldsymbol{\Psi}\boldsymbol{\Lambda}^{\prime} + \boldsymbol{\Theta}, \tag{15.1}
where \boldsymbol{\Lambda} is the P \times M matrix of factor loadings, \boldsymbol{\Psi} is the M \times M covariance matrix of the factors (often written \boldsymbol{\Phi} in the EFA literature; we keep the \boldsymbol{\Psi} notation of the all-y representation of Section 4.1), and \boldsymbol{\Theta} is the diagonal matrix of unique variances. In a confirmatory analysis, most elements of \boldsymbol{\Lambda} are fixed to zero. In an exploratory analysis, all P \times M loadings are free.
15.2.1 Rotational indeterminacy
The unrestricted model Equation 15.1 is not identified. Let \mathbf{M} be any nonsingular M \times M matrix. Then the transformed parameter matrices
\boldsymbol{\Lambda}^{*} = \boldsymbol{\Lambda}\mathbf{M}, \qquad \boldsymbol{\Psi}^{*} = \mathbf{M}^{-1} \boldsymbol{\Psi}(\mathbf{M}^{-1})^{\prime} \tag{15.2}
reproduce exactly the same covariance matrix: \boldsymbol{\Lambda}^{*} \boldsymbol{\Psi}^{*} \boldsymbol{\Lambda}^{*\prime} = \boldsymbol{\Lambda}\boldsymbol{\Psi}\boldsymbol{\Lambda}^{\prime}. All these solutions are therefore observationally equivalent, and the data cannot distinguish between them. The set of transformations has M^2 free elements, so M^2 restrictions are needed to obtain a unique solution. Fixing the factor variances to one (\mathrm{diag}(\boldsymbol{\Psi}) = \mathbf{1}) absorbs M of them; the remaining M(M-1) restrictions must come from elsewhere. The classic strategy proceeds in two steps:
Extraction: estimate one arbitrary (and typically uninterpretable) solution, the unrotated solution, by imposing M(M-1) convenient identification restrictions.
Rotation: replace the unrotated solution by the observationally equivalent solution \boldsymbol{\Lambda}\mathbf{M} that optimizes a simplicity criterion, in the spirit of Thurstone’s simple structure (Thurstone, 1947).
If the rotation is restricted to be orthogonal, the factors remain uncorrelated (\boldsymbol{\Psi}= \mathbf{I}): \mathbf{M} must then be an orthogonal matrix, which has only M(M-1)/2 free elements. An oblique rotation allows the factors to correlate and uses the full M(M-1) degrees of indeterminacy: M(M-1)/2 for the loadings and M(M-1)/2 for the factor correlations.
15.2.2 The echelon pattern of the unrotated solution
The unrotated solution needs M(M-1)/2 identification restrictions on top of the unit factor variances and the zero factor covariances. In the classical EFA literature, the restriction of choice is that the M \times M matrix \boldsymbol{\Lambda}^{\prime} \boldsymbol{\Theta}^{-1} \boldsymbol{\Lambda} be diagonal (Jöreskog, 1967, equation 14 and the sentence following it; Lawley & Maxwell, 1971). This choice has a computational advantage: for given unique variances \boldsymbol{\Theta}, it makes the columns of \boldsymbol{\Theta}^{-1/2}\boldsymbol{\Lambda} eigenvectors of \boldsymbol{\Theta}^{-1/2}\mathbf{S}\boldsymbol{\Theta}^{-1/2}, so that the optimal loadings have a closed form and the likelihood only needs to be maximized over the P unique variances. lavaan uses exactly this eigenvalue-based solution, but only to compute starting values (Section 15.3). To identify the unrotated solution of the fitted model, lavaan uses a different and more flexible device: an echelon (staircase) pattern of fixed zeros, in which the loadings above the “diagonal” of \boldsymbol{\Lambda} are fixed to zero. Factor 2 has a zero loading for the first indicator, factor 3 has zero loadings for the first two indicators, and so on; factor m contributes m - 1 zero restrictions, for a total of M(M-1)/2. Combined with unit factor variances and zero factor covariances, this identifies the unrotated solution (up to sign changes of the columns). The reason for preferring this pattern is that lavaan does not only target EFA: the restrictions are ordinary fixed parameters, so they fit in the parameter table like any other restriction and work unchanged when the EFA block is only one part of a larger ESEM model, with regressions and confirmatory factors around it, where the eigenvalue-based solution is of no use. A triangular pattern of fixed zeros of this kind was already used by Jöreskog (1969) to obtain an unrestricted solution with confirmatory factor analysis software.
These identification restrictions are added to the parameter table automatically, triggered by the auto_efa = TRUE argument of lavParTable() (set automatically by sem(), cfa() and growth(); see Section 3.2.4 and the overview table in Section 3.2.5). For each EFA block (“set”) in each group/level block, it
fixes the echelon loadings to zero, and
fixes the factor covariances within the set to zero (only when the planned rotation is oblique; for an orthogonal rotation, the covariances are already fixed to zero by the
orthogonal_efamechanism).
Crucially, these parameters are not marked as ordinary fixed parameters: their user column is set to the special code 7 (or 77 when equality constraints across groups or blocks make the restrictions redundant; see Section 3.2.2 for all codes in use). After rotation, the user = 7 parameters are freed again (Section 15.6), which is why they must remain distinguishable from genuinely fixed parameters.
Two restrictions follow from this logic. The identification restrictions assume that no other constraints are placed on the loadings of an EFA set: fixing or constraining individual loadings inside a set (other than through group_equal or matching labels across groups) interferes with the echelon pattern and is not supported; a target rotation (Section 15.4.5) is the way to express a pattern hypothesis for an exploratory block. And each factor needs enough indicators: within a set, factor m must have at least m - 1 indicators available for its echelon zeros, and lavaan stops with an error otherwise. In practice, all factors of a set should load on the same indicators.
The easiest way to see the echelon pattern is to ask efa() for the unrotated solution directly, by setting rotation = "none":
fit3_none <- efa(data = HS9, nfactors = 3, rotation = "none",
output = "lavaan")
lavInspect(fit3_none, "est")$lambda f1 f2 f3
x1 0.814 0.000 0.000
x2 0.555 0.197 0.000
x3 0.714 0.172 0.207
x4 0.577 -0.485 -0.637
x5 0.565 -0.593 -0.766
x6 0.576 -0.412 -0.574
x7 0.133 -0.663 0.363
x8 0.322 -0.510 0.424
x9 0.532 -0.305 0.296
The upper-right corner of \boldsymbol{\Lambda} contains (structural) zeros. The parameter table shows the special user codes for exactly these three elements:
PT <- parTable(fit3_none)
PT[PT$op == "=~" & PT$user == 7L, c("lhs", "op", "rhs", "free", "user",
"ustart")] lhs op rhs free user ustart
10 f2 =~ x1 0 7 0
19 f3 =~ x1 0 7 0
20 f3 =~ x2 0 7 0
As expected, the first factor is a “general” factor on which all nine indicators load, while the second and third factors are difficult to interpret. The unrotated solution should be viewed as a way to fix the subspace spanned by the factors, not as a substantively meaningful solution.
15.2.3 Degrees of freedom
Because the identification restrictions are exact restatements of the rotational indeterminacy, they do not affect the fit. The number of independently estimable parameters of an M-factor EFA model is
T= PM + P - \frac{M(M-1)}{2}, \tag{15.3}
(PM loadings minus the echelon zeros, plus P unique variances; the factor variances are fixed), and the degrees of freedom against the saturated covariance matrix are
\mathrm{df} = \frac{P(P+1)}{2} - T = \frac{(P - M)^2 - (P + M)}{2}. \tag{15.4}
For P = 9 and M = 3: \mathrm{df} = (36 - 12)/2 = 12, which matches the fitted object:
fitMeasures(fit3_none, c("chisq", "df", "pvalue")) chisq df pvalue
22.897 12.000 0.029
Equation Equation 15.4 also shows that the number of factors cannot grow without bound: the model only has positive degrees of freedom when (P - M)^2 \ge P + M, the Ledermann bound. The efa() function checks this before fitting and rejects, with an error, values of nfactors for which the number of parameters exceeds the number of sample statistics (for P = 9 the maximum is M = 5).
Every rotated solution is a one-to-one transformation of the unrotated solution, so all rotated solutions share the same model-implied moments \hat{\boldsymbol{\sigma}}, the same log-likelihood, the same test statistics, and the same fit measures. Rotation changes the parameter estimates and their standard errors, and nothing else.
15.3 Estimating the unrotated solution
In the classical EFA literature, estimating the unrotated solution is called factor extraction, and dedicated algorithms exist for it (principal axis factoring, MINRES, the eigenvalue-based maximum likelihood method of Jöreskog (1967)). lavaan does not need any of these: the unrotated model is an ordinary structural equation model, and it is fitted in exactly the same way as any other model in this book. As a consequence, every estimator of chapter 7 is available: estimator = "ML" (the default) with all its variants (missing = "ml" for incomplete data, robust standard errors and test statistics for nonnormal data), but also ULS, GLS, WLS, and DWLS. When the indicators are declared ordered, the usual categorical pipeline applies (chapter 14): lavaan first computes polychoric correlations and then fits the unrotated model with DWLS (or ULS), which yields a categorical EFA without further steps. Multiple groups, sampling weights, and two-level data are supported as well, since the EFA block is part of a regular parameter table.
Two classical extraction methods are nevertheless used in lavaan, in a supporting role: they provide starting values and noniterative estimates.
lavaan implements the concentrated (eigenvalue-based) ULS and ML extraction methods: the unique variances \boldsymbol{\Theta} are the only free parameters, and for a given \boldsymbol{\Theta} the optimal \boldsymbol{\Lambda} has a closed form in terms of the leading eigenvectors of a matrix derived from the sample correlation matrix (Jöreskog, 1967; Lawley & Maxwell, 1971), and the resulting loading matrix is transformed to the echelon pattern. This extraction is run when the starting values for the factor loadings and residual variances of each EFA block are computed. Because the extraction method is itself (quasi) maximum likelihood, these starting values are usually excellent. For complete continuous data they are essentially the ML solution already, up to the N versus N-1 scaling of the input matrix; the implementation notes at the end of this chapter (Section 15.10) show the comparison with the fitted unrotated \boldsymbol{\Lambda} of Section 15.2.2.
lavaan also implements the partitioned covariance matrix estimator (PACE) described by Cudeck (1991), a fast, noniterative, scale-equivariant estimator of the unique variances that goes back to Albert (1944) and Ihara and Kano (1986). For each variable, it selects subsets of “instrumental” variables by sweeping the sample correlation matrix, and obtains an estimate of the unique variance after 2M + 1 sweep operations. In lavaan, PACE serves as a fallback: the noniterative CFA estimators (see Hägglund, 1982) of Section 17.6 use it whenever their own residual-variance computations fail. The same routine can also return a full loading matrix (the eigenvalue solution of page 37 of Cudeck (1991)), but this feature is not used elsewhere in the package.
Finally, note that efa() by default sets bounds = "pos.var", so that the unique variances (and factor variances) are constrained to be nonnegative during optimization; see Section 6.2.2 in chapter 6 for how these bounds are computed.
15.4 Rotation criteria
A rotation criterion is a scalar function Q(\boldsymbol{\Lambda}) that measures the complexity of a loading matrix: the further \boldsymbol{\Lambda} is from an interpretable simple structure, the larger Q. The rotated solution is defined as the transformation of the unrotated matrix \mathbf{A} that minimizes Q:
\min_{\mathbf{M}} \; Q(\mathbf{A}\mathbf{M}) \quad \text{subject to} \quad \begin{cases} \mathbf{M}^{\prime}\mathbf{M} = \mathbf{I} & \text{(orthogonal)}\\ \mathrm{diag}(\mathbf{M}^{-1}(\mathbf{M}^{-1})^{\prime}) = \mathbf{1} & \text{(oblique)}, \end{cases} \tag{15.5}
where the oblique constraint keeps the factor variances equal to one. Browne (2001) gives an authoritative overview of the criteria that have been proposed over the years; lavaan implements nearly all of them. Each criterion is implemented as a small function that returns the value of Q and, when requested, its gradient \partial Q / \partial \boldsymbol{\Lambda}, the only two ingredients the rotation algorithms of Section 15.5 need. The implementation was written from scratch (rather than borrowed from the GPArotation package, Bernaards and Jennrich (2005)) to have direct access to the gradients and to avoid an extra dependency.
The rotation method is selected with the rotation argument of efa(), sem(), cfa() or lavaan(). Table 15.1 lists all accepted values. In the subsections below, \lambda_{pm} denotes element (p,m) of \boldsymbol{\Lambda}, P the number of indicators (rows), and M the number of factors (columns) within the EFA block being rotated.
rotation argument. “Default mode” shows whether the criterion is combined with an oblique or an orthogonal rotation when the rotation option orthogonal is left unspecified; “(forced)” means the option is overridden to TRUE during option processing.
rotation= |
Criterion | Default mode | Reference |
|---|---|---|---|
"geomin" (default) |
geomin (Equation 15.12) | oblique | Yates (1987); Browne (2001) |
"varimax" |
varimax (Equation 15.7) | orthogonal (forced) | Kaiser (1958) |
"quartimax" |
quartimax (Equation 15.8) | oblique (!) | Browne (2001) |
"orthomax" |
orthomax family (Equation 15.6); \gamma = orthomax_gamma |
oblique (!) | Harman (1976) |
"cf", "crawford.ferguson" |
Crawford–Ferguson family (Equation 15.9) | oblique | Crawford and Ferguson (1970) |
"cf.quartimax", "cf.varimax", "cf.equamax", "cf.parsimax", "cf.facparsim" |
CF family with preset \gamma | oblique | Crawford and Ferguson (1970) |
"oblimin" |
oblimin family (Equation 15.10); \gamma = oblimin_gamma |
oblique | Harman (1976) |
"quartimin" |
quartimin (oblimin, \gamma = 0) | oblique | Harman (1976) |
"target.strict" |
fully specified target (Equation 15.13) | oblique | Browne (2001) |
"target", "pst" |
partially specified target (Equation 15.14) | oblique | Browne (2001) |
"bi.quartimin" |
bifactor quartimin | oblique | Jennrich and Bentler (2011) |
"bi.geomin" |
bifactor geomin | oblique | Jennrich and Bentler (2012) |
"promax" |
varimax + procrustes (two-step) | oblique | Hendrickson and White (1964) |
"oblimax" |
oblimax (Equation 15.16) | oblique | Harman (1976) |
"entropy" |
simple entropy (Equation 15.17) | orthogonal (forced) | Browne (2001) |
"mccammon" |
McCammon’s minimum entropy (Equation 15.18) | orthogonal (forced) | Browne (2001) |
"infomax" |
McKeon’s infomax (Equation 15.19) | oblique | Browne (2001) |
"tandem1", "tandem2" |
Comrey’s tandem criteria I/II (Equation 15.22, Equation 15.23) | orthogonal (forced) | Comrey (1967) |
"bentler" |
Bentler’s invariant pattern simplicity (Equation 15.20) | oblique | Bentler (1977) |
"simplimax" |
simplimax (Equation 15.21); k = simplimax_k |
oblique | Kiers (1994) |
"none" |
no rotation (echelon solution) | n/a |
Two remarks about Table 15.1. First, the default is oblique rotation (rotation option orthogonal = FALSE) for every method except varimax, entropy, mccammon and the two tandem criteria, which only make sense (or only behave well) under orthogonality and are therefore forced to be orthogonal. This includes quartimax and orthomax, which are historically orthogonal criteria: the textbook versions are obtained by setting orthogonal = TRUE explicitly. Second, the generic "cf" method takes its \gamma value from the cf_gamma rotation argument (default 0, which gives quartimin); in practice, the named special cases (cf.varimax and the other cf.* variants) are a more readable interface to the CF family.
15.4.1 The orthomax family
The orthomax family (Harman, 1976) penalizes the lack of variability of the squared loadings within each column:
Q_{\text{orthomax}}(\boldsymbol{\Lambda}) = -\frac{1}{4} \sum_{m=1}^{M} \left[ \sum_{p=1}^{P} \lambda_{pm}^4 - \frac{\gamma}{P}\left(\sum_{p=1}^{P} \lambda_{pm}^2\right)^{\!2} \right], \tag{15.6}
where the family parameter \gamma (argument orthomax_gamma, default 1) interpolates between well-known special cases: \gamma = 0 gives quartimax, \gamma = 1/2 biquartimax, \gamma = M/2 equamax, and \gamma = 1 varimax.
With \gamma = 1, Equation 15.6 is (proportional to) minus the sum over factors of the variance of the squared loadings within each column, which is Kaiser’s well-known varimax criterion (Kaiser, 1958):
Q_{\text{varimax}}(\boldsymbol{\Lambda}) = -\frac{1}{4} \sum_{m=1}^{M} \sum_{p=1}^{P} \left(\lambda_{pm}^2 - \overline{\lambda_{m}^2} \right)^2, \qquad \overline{\lambda_{m}^2} = \frac{1}{P}\sum_{p=1}^{P} \lambda_{pm}^2 . \tag{15.7}
Here \overline{\lambda_{m}^2} is the mean of the squared loadings in column m. Maximizing the column variances of \lambda_{pm}^2 drives each column towards a mix of large and near-zero loadings. Varimax is combined by default with Kaiser row weighting (Section 15.5.4).
With \gamma = 0 the criterion reduces to
Q_{\text{quartimax}}(\boldsymbol{\Lambda}) = -\frac{1}{4} \sum_{p=1}^{P}\sum_{m=1}^{M} \lambda_{pm}^4 , \tag{15.8}
which maximizes the fourth moments of the loadings and tends to produce one dominant general factor.
15.4.2 The Crawford–Ferguson family
Crawford and Ferguson (1970) proposed a two-part criterion that penalizes row complexity (an indicator loading on several factors) and column complexity (a factor receiving loadings from many indicators):
Q_{\text{CF}}(\boldsymbol{\Lambda}) = \frac{(1 - \gamma)}{4} \sum_{p=1}^{P} \sum_{m \neq m'} \lambda_{pm}^2 \lambda_{pm'}^2 \; + \; \frac{\gamma}{4} \sum_{m=1}^{M} \sum_{p \neq p'} \lambda_{pm}^2 \lambda_{p'm}^2 . \tag{15.9}
Under orthogonal rotation, the row sums of squares (the communalities) are invariant, and the family is equivalent to orthomax; the named variants fix \gamma accordingly: cf.quartimax (\gamma = 0), cf.varimax (\gamma = 1/P), cf.equamax (\gamma = M/(2P)), cf.parsimax (\gamma = (M-1)/(P+M-2)), and cf.facparsim (\gamma = 1, pure factor parsimony). Unlike orthomax, however, the CF criteria remain sensible under oblique rotation, which is why Browne’s CEFA program, and lavaan, offer them as a family in their own right.
15.4.3 The oblimin family
The (direct) oblimin family, Carroll’s criterion as described by Harman (1976), penalizes products of squared loadings across different columns:
Q_{\text{oblimin}}(\boldsymbol{\Lambda}) = \frac{1}{4}\sum_{m \neq m'} \sum_{p=1}^{P} \lambda_{pm}^2 \left( \lambda_{pm'}^2 - \frac{\gamma}{P} \sum_{p'=1}^{P} \lambda_{p'm'}^2 \right), \tag{15.10}
with oblimin_gamma = \gamma: \gamma = 0 gives quartimin, \gamma = 1/2 biquartimin, and \gamma = 1 covarimin. For orthogonal rotation the family is again equivalent to orthomax. The quartimin special case,
Q_{\text{quartimin}}(\boldsymbol{\Lambda}) = \frac{1}{4} \sum_{m \neq m'} \sum_{p=1}^{P} \lambda_{pm}^2 \lambda_{pm'}^2 , \tag{15.11}
is one of the oldest and best-behaved oblique criteria and is available directly as rotation = "quartimin".
15.4.4 Geomin
The default rotation method in lavaan (as in Mplus) is geomin, originally due to Yates (1987) in the smoothed form popularized by Browne (2001). It minimizes the sum over indicators of the geometric mean of the (slightly shifted) squared loadings:
Q_{\text{geomin}}(\boldsymbol{\Lambda}) = \sum_{p=1}^{P} \left( \prod_{m=1}^{M} \left( \lambda_{pm}^2 + \epsilon \right) \right)^{1/M}. \tag{15.12}
A row contributes little to Q as soon as one of its loadings is near zero, so geomin rewards rows with at least one vanishing loading, a direct translation of Thurstone’s simple structure. The constant \epsilon > 0 (argument geomin_epsilon, default 0.001; earlier versions used 0.01) smooths the criterion: with \epsilon = 0 the geometric mean has a non-differentiable kink at zero loadings, and the rotation problem becomes badly behaved. Larger values of \epsilon make the criterion smoother but also change the solution; Mplus uses values between 0.0001 and 0.01 depending on the number of factors, so exact agreement between packages requires matching \epsilon. Internally, the implementation computes the row products via the numerically stable \exp/\log formulation of Bernaards and Jennrich (2005). Geomin is well known to have multiple local minima; this is the reason random starts are enabled by default (Section 15.5.3).
15.4.5 Target rotation
Instead of an abstract simplicity function, the user may rotate towards a pre-specified target pattern \mathbf{T}, a semi-confirmatory approach that is popular in measurement invariance research. The strict version (rotation = "target.strict") minimizes the total squared deviation from a fully specified target,
Q_{\text{target}}(\boldsymbol{\Lambda}) = \sum_{p,m} \left( \lambda_{pm} - t_{pm} \right)^2, \tag{15.13}
whereas the partially specified target (PST) rotation of Browne (2001) (rotation = "target" or "pst") only counts a subset of cells, selected by a binary weight matrix \mathbf{W}:
Q_{\text{pst}}(\boldsymbol{\Lambda}) = \sum_{p,m} w_{pm} \left( \lambda_{pm} - t_{pm} \right)^2 . \tag{15.14}
Both criteria are minimized by the same gradient projection algorithm as the other criteria of this section, so standard errors and all the other machinery of the chapter remain available. The target matrix \mathbf{T} and the mask \mathbf{W} are passed as the rotation options target and target_mask, that is, as named elements of the list given to the rotation argument (Section 15.5.6). Both are P \times M matrices for the EFA block being rotated: the rows follow the order of the indicators in the model (the order of the variables in the data, or in ov_names, for efa(); the order given by lavNames() for an ESEM), and the columns follow the order in which the factors are declared. The meaning of the cells of the target depends on the rotation method. There are three cases.
The first and most common case is a zero-only target, selected with rotation = "target" (or its synonym "pst") and no mask. Here only the cells of \mathbf{T} that are exactly zero act as targets. Every other cell, whatever its value (1, NA, or any other number), is ignored by the criterion, so the solution is the rotation in which the targeted loadings are as close to zero as possible, while the remaining loadings are free to take any value. Internally lavaan builds the mask with w_{pm} = 1 for the zero cells and w_{pm} = 0 for the nonzero cells, and NA cells are dropped from the criterion directly. For the Holzinger–Swineford data, the natural target is the confirmatory pattern, written with zeros where no loading is expected and ones elsewhere:
target <- matrix(0, nrow = 9, ncol = 3)
target[1:3, 1] <- 1; target[4:6, 2] <- 1; target[7:9, 3] <- 1
target [,1] [,2] [,3]
[1,] 1 0 0
[2,] 1 0 0
[3,] 1 0 0
[4,] 0 1 0
[5,] 0 1 0
[6,] 0 1 0
[7,] 0 0 1
[8,] 0 0 1
[9,] 0 0 1
fit_target <- efa(data = HS9, nfactors = 3,
rotation = list("target", target = target),
output = "lavaan")
round(lavInspect(fit_target, "std")$lambda, 3) f1 f2 f3
x1 0.589 0.174 0.075
x2 0.510 0.032 -0.084
x3 0.676 -0.089 0.073
x4 0.020 0.840 0.008
x5 -0.068 0.890 0.004
x6 0.077 0.805 -0.005
x7 -0.229 0.036 0.736
x8 0.025 -0.047 0.732
x9 0.309 0.017 0.505
The ones in this matrix are not targets of one: they only mark the cells that are ignored. Writing NA instead of 1 is therefore a more accurate notation, and gives the identical solution:
target_na <- target
target_na[target == 1] <- NA
fit_target_na <- efa(data = HS9, nfactors = 3,
rotation = list("target", target = target_na),
output = "lavaan")
max(abs(lavInspect(fit_target_na, "std")$lambda -
lavInspect(fit_target, "std")$lambda))[1] 1.549583e-07
The second case is the strict target, rotation = "target.strict". Now every cell counts, and every cell counts towards its value: a one in the target requests a loading of one. Since the rotation criterion is evaluated on the loadings of the standardized indicators (std_ov = TRUE, Section 15.5.4), the target values must be standardized loadings. The same zero/one matrix therefore produces a different, and worse, solution: the hypothesized loadings are pulled towards one, a value no standardized loading in these data comes close to, and the cross-loadings deteriorate in the process:
fit_strict <- efa(data = HS9, nfactors = 3,
rotation = list("target.strict", target = target),
output = "lavaan")
round(lavInspect(fit_strict, "std")$lambda, 3) f1 f2 f3
x1 0.678 0.056 -0.022
x2 0.626 -0.056 -0.187
x3 0.800 -0.243 -0.019
x4 -0.034 0.896 -0.058
x5 -0.142 0.968 -0.052
x6 0.039 0.850 -0.080
x7 -0.427 -0.031 0.905
x8 -0.116 -0.171 0.865
x9 0.266 -0.124 0.544
A strict target is only useful when realistic values are available for all cells, for example the standardized loadings from an earlier study or from a confirmatory model. With such values (here taken from the three-factor CFA), the strict rotation is close to the zero-only solution above:
model_hs <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
fit_hs <- cfa(model_hs, data = HolzingerSwineford1939)
target_std <- unname(lavInspect(fit_hs, "std")$lambda)
fit_strict2 <- efa(data = HS9, nfactors = 3,
rotation = list("target.strict", target = target_std),
output = "lavaan")
round(lavInspect(fit_strict2, "std")$lambda, 3) f1 f2 f3
x1 0.584 0.172 0.109
x2 0.502 0.029 -0.054
x3 0.665 -0.090 0.113
x4 0.033 0.836 0.005
x5 -0.053 0.887 -0.004
x6 0.088 0.802 -0.004
x7 -0.216 0.042 0.719
x8 0.033 -0.042 0.730
x9 0.311 0.020 0.520
If a strict target contains NA cells, lavaan switches to the partially specified criterion, with a warning: the NA cells are ignored, but the remaining cells, zero or not, keep their values as targets. This is the way to ask for specific nonzero values in some cells while leaving others free, without writing a mask.
The third case is the partially specified target with an explicit mask, rotation = "pst" together with target_mask. The mask gives full control: a cell with w_{pm} = 1 is pulled towards its target value, a cell with w_{pm} = 0 is ignored, whatever the target says there. The zero-only target of the first case is the special case where the mask is the indicator of the zero cells. The explicit form is needed, for example, when only a few loadings should be targeted. The smallest useful mask specifies M - 1 cells per column, here two zero loadings per factor:
mask <- matrix(0, nrow = 9, ncol = 3)
mask[c(4, 7), 1] <- 1; mask[c(1, 7), 2] <- 1; mask[c(1, 4), 3] <- 1
fit_pst <- efa(data = HS9, nfactors = 3,
rotation = list("pst", target = matrix(0, 9, 3),
target_mask = mask),
output = "lavaan")
round(lavInspect(fit_pst, "std")$lambda, 3) f1 f2 f3
x1 0.698 0.000 0.000
x2 0.555 -0.101 -0.137
x3 0.805 -0.292 -0.011
x4 0.000 0.849 0.000
x5 -0.104 0.926 0.006
x6 0.062 0.800 -0.018
x7 0.000 0.000 0.706
x8 0.293 -0.156 0.673
x9 0.536 -0.140 0.430
With exactly M(M - 1) specified cells, as here, the target is matched exactly: the six targeted loadings are zero, and the remaining loadings are determined by the data once that choice of orientation is made. With more specified cells, the rotation is a compromise, and the targeted loadings are close to, but not exactly at, their target values.
A few implications follow from these three cases, and they hold for all target rotations:
A target rotation is still a rotation. Like every other criterion in this section, it leaves the model-implied moments, the chi-square statistic and the fit measures untouched; the fit of
fit_target,fit_strictandfit_pstis identical to that of the geomin solution. The target does not constrain the loadings; it only selects one orientation of the factors. A loading that is targeted at zero but comes out large is therefore informative: the data do not support that part of the hypothesized pattern.The target must identify the rotation. For an oblique rotation, each column of the mask needs at least M - 1 specified cells, in distinct rows, so that the position of each factor is determined (Algina, 1980; Browne, 2001). With fewer specified cells in some column, the criterion is flat along the unspecified directions and the solution for that factor is arbitrary: different random starts return different loadings, all with the same (minimal) criterion value. Masks and zero-only targets with fewer than M - 1 zeros in a column should be avoided.
The values in a target are standardized loadings (unless
std_ov = FALSE); a zero-only target is unaffected by this, but a strict or value target must be written in the standardized metric.Since the target defines the orientation of the factors, the columns are not reordered after the rotation (
order_lv_byis forced to"none"), so the factors come out in the order of the target columns. Columns with a negative sum are still reflected (reflect = TRUE); a target with predominantly negative values in some column therefore requiresreflect = FALSE.
Finally, for multiple groups and for models with several EFA blocks, the target (and the mask) may be a list of matrices. A nameless list is interpreted as one matrix per group, in the order of the groups; a named list is keyed by the EFA block labels of the model syntax, so that each block gets its own target (the same target is then used in all groups), and every block with two or more factors must be present in the list. In code:
# one target for all groups and blocks
rotation = list("target", target = target)
# one target per group (two groups)
rotation = list("target", target = list(target_g1, target_g2))
# one target per EFA block, for efa("a") and efa("b") in the syntax
rotation = list("target", target = list(a = target_a, b = target_b))When both a target and a mask are given as lists, they must use the same convention (both nameless or both named).
15.4.6 Bifactor rotation
The bifactor criteria of Jennrich and Bentler (2011) and Jennrich and Bentler (2012) adapt quartimin and geomin to models with a general factor: the first column of \boldsymbol{\Lambda} is exempted from the simplicity criterion, which is applied only to the remaining M - 1 “group factor” columns,
Q_{\text{bi-}q}(\boldsymbol{\Lambda}) = Q_{q}(\boldsymbol{\Lambda}_{[,-1]}), \tag{15.15}
with q either quartimin (rotation = "bi.quartimin") or geomin (rotation = "bi.geomin"). The general factor is thus free to load on all indicators, while the group factors are rotated to simple structure. The general factor stays in the first column, where the criterion puts it; the ordering rule of order_lv_by (Section 15.5.5) is applied to the group factors only, so that their order does not depend on which random start provides the solution. The same pinning of the first column applies when the group solutions are aligned to the first group in a multiple-group rotation (Section 15.9) and when bootstrap replications are aligned to the full-sample solution (Section 15.6.3): the general factor only has its sign aligned, and the signed-permutation search runs over the group factors.
15.4.7 Remaining criteria
The remaining entries of Table 15.1 are provided mainly for completeness and for methodological research; Browne (2001) discusses their properties in detail. For reference, we give the criterion Q of each of them in the form in which lavaan minimizes it. Several of these criteria are built from the squared loadings \lambda_{pm}^2 and their sums, for which we write
r_p = \sum_{m=1}^{M} \lambda_{pm}^2, \qquad c_m = \sum_{p=1}^{P} \lambda_{pm}^2, \qquad s = \sum_{p=1}^{P} \sum_{m=1}^{M} \lambda_{pm}^2,
for the row sums (the communalities), the column sums, and the total. Two of them use the entropy function of information theory, which for a vector \mathbf{x} of nonnegative elements that sum to one is defined as H(\mathbf{x}) = -\sum_i x_i \log x_i, with the convention 0 \log 0 = 0. The entropy is zero when a single element equals one and all others are zero, and maximal (equal to the log of the number of elements) when all elements are equal.
Oblimax (Saunders’ criterion; see Harman (1976)) is a kurtosis-like ratio of the fourth to the squared second moments of the loadings. lavaan minimizes its negative logarithm,
Q_{\text{oblimax}}(\boldsymbol{\Lambda}) = -\log \sum_{p=1}^{P}\sum_{m=1}^{M} \lambda_{pm}^4 + 2 \log \sum_{p=1}^{P}\sum_{m=1}^{M} \lambda_{pm}^2 . \tag{15.16}
Under orthogonal rotation the total s is invariant, so the second term is a constant and oblimax reduces to quartimax. It was proposed as an oblique criterion, where the denominator matters.
The entropy criterion (listed as “simple entropy” in Table 15.1) applies the entropy function to the matrix of squared loadings as a whole,
Q_{\text{entropy}}(\boldsymbol{\Lambda}) = -\frac{1}{2} \sum_{p=1}^{P}\sum_{m=1}^{M} \lambda_{pm}^2 \log \lambda_{pm}^2 . \tag{15.17}
Under orthogonal rotation, where s is fixed, minimizing this quantity concentrates the squared loadings in as few cells as possible. It is forced to be orthogonal in lavaan, since under oblique rotation it can be decreased without bound by letting factors collapse.
McCammon’s minimum entropy criterion (McCammon, 1966; see also Browne, 2001) balances the within-column entropies against the entropy of the column sums. Writing \mathbf{x}_m for the vector of proportions \lambda_{pm}^2 / c_m (p = 1, \ldots, P) within column m, and \mathbf{c}/s for the vector of proportions c_m / s of the column sums, lavaan minimizes
Q_{\text{mccammon}}(\boldsymbol{\Lambda}) = \log \sum_{m=1}^{M} H(\mathbf{x}_m) - \log H(\mathbf{c}/s) . \tag{15.18}
The first term rewards columns with a few large and many small squared loadings; the second term is smallest when the column sums are equal, so the criterion also discourages a dominant general factor. McCammon intended it for orthogonal rotation only, and Browne (2001) reports that it is unsatisfactory in oblique rotation, which is why lavaan forces orthogonality.
McKeon’s infomax criterion (Browne, 2001; McKeon, 1968) treats the matrix of squared loadings as a two-way contingency table and maximizes the association between its rows and columns, measured by mutual information. Subtracted from its upper bound, this becomes the complexity function
Q_{\text{infomax}}(\boldsymbol{\Lambda}) = \log M + H(\mathbf{S}/s) - H(\mathbf{c}/s) - H(\mathbf{r}/s) , \tag{15.19}
where \mathbf{S}/s is the full P \times M matrix of proportions \lambda_{pm}^2 / s (the entropy is taken over all PM cells), and \mathbf{r}/s the vector of proportions r_p / s of the row sums. This is the formulation of Bernaards and Jennrich (2005); the version in Browne (2001) uses the within-column proportions \lambda_{pm}^2 / c_m in the first term instead. The criterion attains its minimum of zero for a perfect cluster configuration (one nonzero loading per row) with equal column sums, and it behaves well in both orthogonal and oblique rotation.
Bentler’s invariant pattern simplicity criterion (Bentler, 1977) is based on the M \times M matrix \mathbf{S}^{\prime}\mathbf{S} of cross-products among the columns of the matrix \mathbf{S} of squared loadings:
Q_{\text{bentler}}(\boldsymbol{\Lambda}) = -\frac{1}{4} \left[ \log \det(\mathbf{S}^{\prime}\mathbf{S}) - \log \det\left(\mathrm{diag}(\mathbf{S}^{\prime}\mathbf{S})\right) \right] . \tag{15.20}
The bracketed quantity is the log-determinant of the correlation-like matrix obtained by scaling \mathbf{S}^{\prime}\mathbf{S} to a unit diagonal. It is zero when the columns of squared loadings are mutually orthogonal, that is, when no indicator has substantial squared loadings in two columns, and it decreases as the columns overlap more. The criterion is invariant to a rescaling of the columns of \mathbf{S}, hence its name.
Simplimax (Kiers, 1994) is an oblique rotation towards an optimal target with a given number k of zero cells. In the gradient-based form used by lavaan (following the GPArotation package), the criterion is the sum of the k smallest squared loadings,
Q_{\text{simplimax}}(\boldsymbol{\Lambda}) = \sum_{(p,m) \in \mathcal{K}} \lambda_{pm}^2 , \tag{15.21}
where \mathcal{K} is the set of the k cells with the smallest squared loadings at the current \boldsymbol{\Lambda}. This is a partially specified target rotation (Section 15.4.5) with a zero target and a mask that is redetermined at every evaluation. The number k is set by the rotation option simplimax_k; its default value 0 stands for k = P(M - 1), the number of zeros of a perfect cluster solution in which every indicator loads on exactly one factor. Kiers (1994) recommends comparing solutions for several values of k.
The tandem criteria of Comrey (1967) bring the correlations among the indicators into the criterion. Let \rho_{pp'} = \sum_m \lambda_{pm}\lambda_{p'm} be the correlation between indicators p and p' reproduced by the (orthogonal) factors, and let \sum_m \lambda_{pm}^2 \lambda_{p'm}^2 measure the extent to which the two indicators load on the same factors. Tandem I,
Q_{\text{tandem I}}(\boldsymbol{\Lambda}) = -\sum_{p=1}^{P}\sum_{p'=1}^{P} \rho_{pp'}^2 \sum_{m=1}^{M} \lambda_{pm}^2 \lambda_{p'm}^2 , \tag{15.22}
rewards solutions in which highly correlated indicators load on the same factors, while tandem II,
Q_{\text{tandem II}}(\boldsymbol{\Lambda}) = \sum_{p=1}^{P}\sum_{p'=1}^{P} \left( 1 - \rho_{pp'}^2 \right) \sum_{m=1}^{M} \lambda_{pm}^2 \lambda_{p'm}^2 , \tag{15.23}
penalizes solutions in which uncorrelated indicators load on the same factors. Comrey proposed to use them in sequence: tandem I to locate the major factors (and to decide how many to retain), tandem II to rotate the retained factors to simple structure. Both are orthogonal criteria and are forced to be orthogonal in lavaan.
Finally, promax (Hendrickson & White, 1964) is not a criterion but a two-step procedure: a varimax rotation is followed by an oblique procrustes rotation towards an “idealized” power-transformed pattern (power promax_kappa, default 4). lavaan borrows the varimax step from base R and implements the procrustes step itself (see the implementation notes at the end of this chapter). Because promax does not use the gradient-based algorithms, no standard errors are available: se is forced to "none". Promax is included only for comparability with legacy software; for a modern oblique rotation, geomin, quartimin or a CF criterion should be preferred.
15.5 The rotation algorithms
Given the unrotated matrix \mathbf{A} of an EFA block and a criterion Q, the actual optimization of Equation 15.5 is carried out by a single rotation routine that performs the main work of the chapter: it evaluates row weights, runs the rotation algorithm (possibly from many random starts), and post-processes the solution (reflection and reordering of the factors). We discuss each step in turn, and then summarize all the rotation options and how they are passed.
Throughout this section it is useful to fix the parameterization. lavaan follows Jennrich (2002) (and the GPArotation package) and optimizes over the M \times M matrix \mathbf{T}:
\text{orthogonal:}\quad \boldsymbol{\Lambda}= \mathbf{A}\mathbf{T}, \;\; \boldsymbol{\Psi}= \mathbf{I}, \qquad \text{oblique:}\quad \boldsymbol{\Lambda}= \mathbf{A}(\mathbf{T}^{\prime})^{-1}, \;\; \boldsymbol{\Psi}= \mathbf{T}^{\prime}\mathbf{T}, \tag{15.24}
where \mathbf{T} is constrained to be orthogonal (\mathbf{T}^{\prime}\mathbf{T} = \mathbf{I}) in the first case and normal (unit-length columns, so that \mathrm{diag}(\boldsymbol{\Psi}) = \mathbf{1}) in the second. In both cases \boldsymbol{\Lambda}\boldsymbol{\Psi}\boldsymbol{\Lambda}^{\prime} = \mathbf{A}\mathbf{A}^{\prime}, so the model-implied covariance matrix is untouched.
15.5.1 The gradient projection algorithm
The default algorithm (rotation option algorithm = "gpa") is the gradient projection algorithm (GPA) of Jennrich (2001) for the orthogonal case and Jennrich (2002) for the oblique case, in the unified formulation of Bernaards and Jennrich (2005), on whose published code lavaan’s implementation is directly based. Write f(\mathbf{T}) = Q(\boldsymbol{\Lambda}(\mathbf{T})) for the criterion as a function of \mathbf{T}. Its gradient is obtained from the criterion gradient \mathbf{G}_q = \partial Q / \partial
\boldsymbol{\Lambda} by the chain rule:
\mathbf{G} = \frac{\partial f}{\partial \mathbf{T}} = \begin{cases} \mathbf{A}^{\prime} \mathbf{G}_q & \text{(orthogonal)}\\[2pt] -\,(\mathbf{T}^{\prime})^{-1}\,\mathbf{G}_q^{\prime}\, \boldsymbol{\Lambda}& \text{(oblique)}. \end{cases} \tag{15.25}
Each iteration takes a steepest-descent step \mathbf{X} = \mathbf{T} -
\alpha \mathbf{G}_p in the direction of the projected gradient \mathbf{G}_p (the component of \mathbf{G} tangent to the constraint manifold), and then projects \mathbf{X} back onto the manifold: in the orthogonal case via the singular value decomposition (\mathbf{X} =
\mathbf{U}\mathbf{D}\mathbf{V}^{\prime} \Rightarrow \mathbf{T} =
\mathbf{U}\mathbf{V}^{\prime}), in the oblique case by renormalizing the columns of \mathbf{X} to unit length. The algorithm stops when the Frobenius norm of \mathbf{G}_p drops below gpa_tol (default 10^{-5}) or after max_iter (default 10000) iterations.
What remains is the choice of the step size \alpha, which is governed by the gpa_algorithm option. In the original algorithm (gpa_algorithm = "legacy"), the previously accepted step size is doubled and then halved until the criterion decreases sufficiently (a monotone line search). In line with recent versions of the GPArotation package, the default is gpa_algorithm = "bb": the trial step size is set by the two-point method of Barzilai and Borwein (1988), \alpha = \|\Delta\mathbf{T}\|^2 / |\langle \Delta\mathbf{T},
\Delta\mathbf{G}_p \rangle|, where \Delta denotes the change between two successive iterations. This inexpensive secant-type approximation of the curvature typically needs far fewer iterations than steepest descent with step halving, but it does not decrease the criterion at every iteration. It is therefore combined with the non-monotone line search of Grippo et al. (1986): a step is accepted if it improves sufficiently on the worst criterion value of the last gpa_fwindow iterations (the default 0 means 10 for "bb", and 1, a monotone search, for "legacy"). For orthogonal rotation only, a third variant (gpa_algorithm = "cayley") replaces the SVD projection by the Cayley transform, which moves along a descent curve that never leaves the manifold of orthogonal matrices. All three variants converge to the same stationary points; they differ only in speed and, at very tight tolerances where the legacy line search tends to stall, in robustness.
In the oblique case, a trial step may produce a (numerically) singular \mathbf{X}. This is treated as a failed step (the step size is halved and the step is retried). A related problem is factor collapse: some criteria are unbounded below for oblique rotation (for example, oblimin with \gamma > 0), so that the algorithm can drift towards a solution in which two factors correlate (nearly) perfectly while the criterion keeps decreasing. A run in which the factors have collapsed, or in which the criterion has diverged far below its starting value, is flagged as degenerate. Degenerate random starts (Section 15.5.3) are discarded with a warning, so that they cannot be selected as the solution with the lowest criterion value; if all the starts fail, an informative error is raised.
The projected gradient is zero exactly at the stationary points of the constrained problem, a fact we will exploit again in Section 15.6. GPA is attractive precisely because it needs nothing beyond Q and \mathbf{G}_q: adding a new rotation criterion to lavaan means writing one small function.
Everything the algorithm produces is kept in the fitted object and can be retrieved with the "rotation" keyword of lavInspect(). It returns, per EFA block, the method and the algorithm, the convergence flag and the number of iterations, the criterion value at the optimum, the rotation matrix \mathbf{T}, the factor correlation matrix \mathbf{T}^{\prime}\mathbf{T}, the column permutation that was applied, and the results of the random starts. We fit the default three-factor geomin solution here, since it serves as the running example for the rest of the chapter, and show the scalar elements:
set.seed(1234)
fit3 <- efa(data = HS9, nfactors = 3, output = "lavaan")
rot3 <- lavInspect(fit3, "rotation")$efa
data.frame(rot3[c("method", "algorithm", "converged", "iterations",
"criterion")]) method algorithm converged iterations criterion
1 geomin gpa TRUE 34 0.188389
The list is keyed by the EFA block label, which is "efa" for a model generated by efa(). The remaining elements are illustrated below, where they are relevant.
15.5.2 The pairwise algorithm
As an alternative, the rotation option algorithm = "pairwise" selects a plane-wise algorithm in the tradition of Kaiser’s original varimax procedure (Kaiser, 1958) and the direct oblimin algorithm of Jennrich and Sampson, made generic for any criterion as suggested by Browne (2001, p. 130). Instead of moving all of \mathbf{T} at once, one sweep visits every pair of factors (every plane) in turn and minimizes Q over the one-parameter transformation of that plane, holding the other columns fixed. Sweeps are repeated until no plane can be improved. The algorithm is gradient-driven: every evaluation of a criterion returns Q and \mathbf{G}_q, and both are used to decide which planes to visit and where the minimum within a plane lies.
For orthogonal rotation, the transformation of the plane of columns (m, m') is a Givens rotation by an angle t,
\boldsymbol{\lambda}_m(t) = \cos t \; \boldsymbol{\lambda}_m - \sin t \; \boldsymbol{\lambda}_{m'}, \qquad \boldsymbol{\lambda}_{m'}(t) = \sin t \; \boldsymbol{\lambda}_m + \cos t \; \boldsymbol{\lambda}_{m'}, \tag{15.26}
with t \in [-\pi/4, \pi/4] (a larger angle only permutes or reflects the two columns), and \boldsymbol{\Psi}= \mathbf{I} throughout; a sweep visits M(M-1)/2 planes. For oblique rotation, the transformation of the ordered pair (m, m') is a shear that replaces factor m by a normalized combination of itself and factor m'. With \phi_{mm'} the current correlation between the two factors, a shear parameter \delta with |\delta| \le 1, and \gamma = (1 + 2\delta\phi_{mm'} + \delta^2)^{1/2}, the loadings and the factor correlations change as
\boldsymbol{\lambda}_m \leftarrow \gamma \, \boldsymbol{\lambda}_m, \qquad \boldsymbol{\lambda}_{m'} \leftarrow \boldsymbol{\lambda}_{m'} - \delta \, \boldsymbol{\lambda}_m, \qquad \phi_{m m''} \leftarrow \frac{\phi_{m m''} + \delta\,\phi_{m' m''}}{\gamma} \quad (m'' \neq m), \tag{15.27}
where \gamma keeps the variance of the new factor m equal to one. Only factor m moves, so the plane (m, m') differs from the plane (m', m), and a sweep visits M(M-1) planes. The sweep must start from the current factor correlation matrix, since the normalization depends on it; this matters when the starting matrices are themselves obliquely rotated, as in the multiple-group rotation of Section 15.9.
The derivative of Q along a plane at the current point costs nothing beyond the gradient that is already available. Writing \mathbf{g}_m for column m of \mathbf{G}_q,
g_0 = \frac{d Q}{d t}\Big|_{t = 0} = \begin{cases} -\langle \mathbf{g}_m, \boldsymbol{\lambda}_{m'} \rangle + \langle \mathbf{g}_{m'}, \boldsymbol{\lambda}_m \rangle & \text{(orthogonal)}\\[2pt] \phi_{mm'} \langle \mathbf{g}_m, \boldsymbol{\lambda}_m \rangle - \langle \mathbf{g}_{m'}, \boldsymbol{\lambda}_m \rangle & \text{(oblique)}, \end{cases} \tag{15.28}
with \langle \cdot, \cdot \rangle the inner product of two vectors. These plane derivatives are the components of the projected gradient \mathbf{G}_p of Section 15.5.1 expressed in the directions of the planes: for orthogonal rotation, \|\mathbf{G}_p\|^2 = \tfrac{1}{2}
\sum_{m < m'} g_{0,mm'}^2. The pairwise algorithm therefore uses the same convergence standard as GPA, and the same option: it stops when the largest |g_0| over all planes drops below gpa_tol. A plane whose derivative is already far below the tolerance (by a factor 100) is skipped without evaluating Q, so that a sweep near convergence only touches the planes that still matter.
Within a plane that is visited, the one-dimensional problem is solved exactly, in one of three ways.
For orthogonal rotation with a criterion that is a quadratic form in the squared loadings with the same coefficient structure for every pair of columns (the orthomax family including quartimax and varimax, the Crawford–Ferguson family, and the oblimin family including quartimin), the row sums \lambda_{pm}^2 + \lambda_{pm'}^2 are invariant under Equation 15.26, and the criterion restricted to the plane has the closed form
Q(t) = a + b \cos 4t + c \sin 4t , \tag{15.29}
of which Kaiser’s varimax formula is the special case with b and c written out. Since Q(0) = a + b and Q'(0) = 4c = 4 g_0 are already known, a single additional evaluation at t = \pi/8 (where Q = a + c) fixes the three coefficients, and the minimizer follows from 4 t^{*} = \mathrm{atan2}(c, b) + \pi, wrapped into the admissible interval. One more evaluation at t^{*} provides the gradient for the next planes: two evaluations per plane. Not every polynomial criterion has this form; the bifactor variant of quartimin, for example, does not, because excluding the general factor breaks the symmetry between the two columns.
For every other criterion with a gradient (geomin, the entropy and information criteria, Bentler’s criterion, the tandem criteria, the target criteria, the bifactor criteria, and all criteria under oblique rotation), the minimizer is found as the zero of Q'(t) by a secant search: a Newton trial step t_1 = -g_0 / \hat{\kappa} from the curvature \hat{\kappa} remembered for this plane from the previous sweep (a fixed fraction of the maximal step in the first sweep), expansion of the step until Q' changes sign, and a few modified regula falsi iterations within the bracket. The best evaluated point is taken, and only if it lowers Q. This typically costs three to six evaluations per plane, against fifteen to twenty-five for a derivative-free search.
For a criterion without a usable gradient, lavaan falls back to a derivative-free line search per plane (Brent’s method) and declares convergence when the criterion changes by less than
tol(default 10^{-8}) over a sweep. This is the original form of the algorithm, and the only place wheretolis used. Simplimax (Equation 15.21) always takes this path: its criterion has kinks where the set of the k smallest loadings changes, and the derivative-based search tends to stall in poor local minima.
Plane sweeps converge linearly, and the sequence of cumulative transformations \mathbf{M}_k after sweep k (so that \boldsymbol{\Lambda}_k
= \mathbf{A} \mathbf{M}_k) is therefore extrapolated after every sweep (rotation option pairwise_accelerate, default TRUE). With \mathbf{d}_k = \mathbf{M}_k - \mathbf{M}_{k-1} and the contraction ratio r = \|\mathbf{d}_k\| / \|\mathbf{d}_{k-1}\|, the extrapolated point is
\mathbf{M}^{*} = \mathbf{M}_k + \frac{r}{1 - r} \, \mathbf{d}_k , \tag{15.30}
Aitken’s \Delta^2 acceleration applied to the whole transformation (only when r lies in a safe range, and with the factor capped). The point is projected back onto the manifold, by the polar projection for orthogonal rotation and by rescaling the columns so that the factors keep unit variance for oblique rotation, and accepted only if it lowers the criterion, at the cost of one evaluation per sweep. The optima are unchanged, and the number of sweeps drops by a factor of 1.5 to 4 on the multiple-group problems of Section 15.9.
Single-group solutions of the pairwise algorithm coincide with those of GPA to about 10^{-6} for all criteria on which both have been compared, since both stop at the same stationarity standard. GPA remains the default. The pairwise algorithm is the natural engine when the objective couples several loading matrices through a cheap per-plane update, as in the multiple-group agreement rotation, for criteria that are not smooth, and as an independent check of a GPA solution. Like GPA, it guards against factor collapse in oblique rotation: a plane step that would push a factor correlation to one is refused, a sweep that drives the criterion far below its starting value is stopped, and such a run is flagged as degenerate, with the same consequences as in Section 15.5.1 (it is discarded in the random-start competition of Section 15.5.3, and an error is raised if all starts fail).
15.5.3 Random starts and local minima
Rotation criteria, geomin in particular, often have several local minima, and both algorithms only converge to a stationary point near their starting value. lavaan therefore restarts the algorithm from a number of random rotation matrices (rotation option rstarts, default 30) and keeps the solution with the lowest criterion value. The random orthogonal start matrices are generated from the QR decomposition of a standard normal matrix, following Stewart (1980), with the sign convention that makes the distribution uniform (Haar) over the orthogonal group. This mirrors the rstarts strategy for the estimation stage discussed in Section 6.3, but note the two are unrelated options: here only the (fast) rotation step is restarted, so the default of 30 restarts adds little computing time. For a criterion with a pronounced local-minimum problem, increasing rstarts is the first remedy when a rotated solution appears unstable. The "rotation_starts" keyword of lavInspect() returns the criterion value, the number of iterations, the convergence flag and the rotation matrix of every start; tabulating the values shows how many starts ended in each local minimum:
starts <- lavInspect(fit3, "rotation_starts")$efa
table(round(starts$value, 4))0.1884 0.19
13 17
The local minima of geomin are visible here: a substantial share of the starts end in a second local minimum with a slightly higher criterion value. The start with the smallest value provided the solution. The default of 30 random starts is not a guarantee: for geomin with many factors, raising rstarts and comparing the solutions across seeds is an inexpensive safeguard. The random starts make the rotation stochastic, so reproducibility across runs requires setting the random seed.
15.5.4 Row weights and standardization
Two preprocessing options modify the matrix that enters the rotation criterion; both are undone after the rotation, so they influence which solution is found but not the model fit.
The first, standardization (rotation option std_ov, default TRUE), divides the rows of \mathbf{A} by the model-implied standard deviations of the indicators, so the criterion operates on the loadings of the standardized observed variables. Rotation criteria are not invariant to the scaling of the indicators; standardizing first makes the result independent of arbitrary units of measurement, and matches what traditional EFA software does (which analyzes a correlation matrix to begin with). The summary() header line Standardized metric TRUE refers to this option.
The second, row weighting (rotation option row_weights), applies after standardization: each row can additionally be weighted:
"none": no weighting (the default for all methods except varimax and promax);"kaiser": Kaiser normalization; row p is divided by the square root of its communality, \left(\sum_m a_{pm}^2\right)^{1/2}, so that all rows have unit length on the criterion scale. This prevents high-communality indicators from dominating the rotation and is classically combined with varimax (Kaiser, 1958);"cureton.mulaik": the weights of Cureton and Mulaik (1975) (multiplied by the Kaiser weights, as in Browne’s CEFA program), which downweight indicators whose loading pattern resembles the first principal component and are designed to help when some indicators have near-zero complexity weights.
The default value "default" resolves to "kaiser" for varimax and promax, and to "none" otherwise. After the optimal \mathbf{T} has been found on the weighted matrix, the weights are divided out of \boldsymbol{\Lambda} again (and the standardization is undone), so the reported loadings are always in the original metric of the model.
15.5.5 Reflection and ordering of the factors
Even after rotation, two trivial indeterminacies remain: each column of \boldsymbol{\Lambda} can be multiplied by -1, and the columns can be permuted. lavaan resolves both with deterministic conventions, applied at the end of the rotation (and mirrored in the rotation matrix, so that Equation 15.24 remains internally consistent):
Reflection (rotation option
reflect, defaultTRUE): any column with a negative column sum is sign-flipped, so each factor is positively oriented towards its indicators.Ordering (rotation option
order_lv_by): the columns are permuted according to one of three rules:"index"(the default): the ordering rule of Asparouhov and Muthén (2009, Appendix D). For each factor, find the indicators whose absolute loading is at least 80% of the factor’s largest absolute loading, and compute the mean of their row indices; factors are ordered by this average. In effect, factors are ordered by where in the indicator list their salient loadings occur, which tends to reproduce the order in which a user would have written the factors down."sumofsquares": decreasing column sums of squared loadings (the “explained variance” order familiar from classic EFA output)."none": keep the order produced by the algorithm (forced for target and PST rotations). For the bifactor rotations, the chosen rule is applied to the group factors only, while the general factor stays in the first column (Section 15.4.6).
The permutation that was applied is returned by the "lv_order" keyword of lavInspect(): element k is the column of the rotated solution that was placed in position k.
lavInspect(fit3, "lv_order")f1 f2 f3
2 1 3
These conventions matter for more than presentation: the standard errors of Section 15.6 and the bootstrap alignment of Section 15.6.3 both assume a deterministic, reproducible orientation of the factors.
15.5.6 The rotation options
All options of the rotation step are passed through the rotation argument of efa(), sem(), cfa() and lavaan(). Instead of a single method name, rotation then takes a list whose first element is the method name and whose remaining, named elements are the rotation options, as in
rotation = list("geomin", geomin_epsilon = 0.01, rstarts = 100)Options that are not given keep their built-in defaults, and the names are matched with dots and underscores interchangeable. This works the same way for an EFA fitted with efa() and for an ESEM fitted with sem() or cfa(). Table 15.2 lists the complete set of options with the built-in defaults.
| Option | Default | Meaning |
|---|---|---|
orthogonal |
FALSE |
orthogonal (TRUE) or oblique (FALSE) rotation; forced TRUE for varimax, entropy, mccammon, tandem1/2 |
row_weights |
"default" |
"none", "kaiser" or "cureton.mulaik"; default resolves per method (Section 15.5.4) |
std_ov |
TRUE |
rotate loadings of standardized observed variables |
geomin_epsilon |
0.001 |
smoothing constant \epsilon in Equation 15.12 |
orthomax_gamma |
1 |
\gamma in Equation 15.6 |
cf_gamma |
0 |
\gamma in Equation 15.9 |
oblimin_gamma |
0 |
\gamma in Equation 15.10 |
promax_kappa |
4 |
power \kappa of the promax target |
simplimax_k |
0 |
number k of loadings driven to zero by simplimax (Equation 15.21); 0 means P(M-1) |
target, target_mask |
empty | target and weight matrices for (partially specified) target rotation; matrix or (named/unnamed) list |
rstarts |
30 |
number of random starts (Section 15.5.3) |
algorithm |
"gpa" |
"gpa" (Section 15.5.1) or "pairwise" (Section 15.5.2) |
pairwise_accelerate |
TRUE |
sweep-level extrapolation of the pairwise algorithm (Equation 15.30) |
reflect |
TRUE |
sign-flip columns with negative sums |
order_lv_by |
"index" |
"index", "sumofsquares" or "none" |
gpa_tol |
1e-5 |
convergence tolerance on the projected gradient, for both algorithms |
gpa_algorithm |
"bb" |
step-size strategy of GPA (Section 15.5.1): "bb" (Barzilai–Borwein, current default), "cayley" (orthogonal rotation only), or "legacy" (the earlier step doubling/halving) |
gpa_fwindow |
0 |
window width of the non-monotone line search of GPA; 0 = automatic (10 for "bb"/"cayley", 1 for "legacy") |
tol |
1e-8 |
convergence tolerance on the change of the criterion, for the derivative-free plane search of the pairwise algorithm only |
max_iter |
10000 |
maximum number of iterations |
warn, verbose |
FALSE |
warnings / iteration trace of the rotation step only |
jac_init_rot |
TRUE |
use the fitted rotation matrix as starting value inside the delta-method Jacobian (Section 15.6.2) |
mg_agreement, mg_agreement_* |
FALSE |
the multiple-group agreement rotation and its settings; see Table 15.3 in Section 15.9.3 |
Related, but not rotation options in this sense, are the method name itself (the first element of the rotation list) and the top-level argument rotation_se ("bordered" or "delta", see Section 15.6).
The options in Table 15.2 are also the checklist for comparing rotated solutions across software. Agreement with Mplus, GPArotation or psych requires matching every convention: the criterion constant (for example geomin_epsilon), std_ov, the row weights, the orthogonal/oblique switch, and the reflection and ordering rules. A difference in any of them produces loadings that look wrong but are merely differently normalized rotations of the same subspace.
15.5.7 Rotating a fitted model
Inside a fitted lavaan model, the rotation is orchestrated by a driver that loops over all blocks (groups and levels) and, within each block, over all EFA sets. For every set with at least two factors, it extracts the unrotated \mathbf{A} from the block’s \boldsymbol{\Lambda} matrix, runs the rotation routine, and embeds the resulting \mathbf{T} into a block-level rotation matrix \mathbf{H} that equals the identity for all non-EFA factors. (Sets with a single factor are only sign-reflected if needed.) The matrix \mathbf{H} is then applied to all factor-related model matrices:
\boldsymbol{\Lambda}\rightarrow \boldsymbol{\Lambda}(\mathbf{H}^{\prime})^{-1}, \qquad \boldsymbol{\Psi}\rightarrow \mathbf{H}^{\prime} \boldsymbol{\Psi}\mathbf{H}, \qquad \mathbf{B}\rightarrow \mathbf{H}^{\prime} \mathbf{B} (\mathbf{H}^{\prime})^{-1}, \qquad \boldsymbol{\alpha}\rightarrow \mathbf{H}^{\prime} \boldsymbol{\alpha}, \tag{15.31}
which are the ESEM transformation formulas of Asparouhov and Muthén (2009) (the \boldsymbol{\nu} and \boldsymbol{\Theta} matrices are unaffected). ESEM rests on these formulas: when EFA factors appear in regressions (\mathbf{B}) or have intercepts (\boldsymbol{\alpha}), those parameters are rotated together with the loadings, and the model-implied moments are exactly preserved. The per-block matrix \mathbf{H} is returned by the "rotation_matrix" keyword (alias "rot") of lavInspect(), with the sign reflections and the column permutation of Section 15.5.5 folded in, and the "est_unrotated" keyword returns the model matrices before rotation, so that Equation 15.31 can be verified directly. For an oblique EFA block, \mathbf{H} coincides with \mathbf{T}, so \mathbf{H}^{\prime}\mathbf{H} reproduces the factor correlations:
H <- lavInspect(fit3, "rotation_matrix")
A <- lavInspect(fit3, "est_unrotated")$lambda
max(abs(A %*% solve(t(H)) - lavInspect(fit3, "est")$lambda))[1] 2.220446e-16
round(crossprod(H), 3) f1 f2 f3
f1 1.000 0.373 0.432
f2 0.373 1.000 0.306
f3 0.432 0.306 1.000
15.6 Standard errors for the rotated solution
Point estimates for the rotated parameters follow directly from the transformation in Equation 15.31. Standard errors are more difficult: the rotated loadings are complicated implicit functions of the unrotated parameters, and their sampling variability includes the variability of the rotation matrix itself. Applying the rotation to the unrotated standard errors would be incorrect. The problem has a long history (Archer & Jennrich, 1973; Jennrich, 1973), and lavaan implements two general solutions, selected by the rotation_se option: the bordered approach ("bordered", the default) and the delta approach ("delta"). Both are post-estimation computations: the rotation, and the standard errors of the rotated parameters, are only computed after the unrotated model has been estimated and its usual variance–covariance matrix (of the requested se type) has been assembled. The rotation step is then carried out.
It first stores some information that is visible in the fitted object. The unrotated estimates and standard errors are preserved in the parameter table as the columns est.unrotated and se.unrotated (and the unrotated free-parameter numbering as free.unrotated); the est and se columns are then overwritten with their rotated counterparts. The user = 7 identification parameters of Section 15.2.2 (echelon zeros and, for oblique rotation, the factor covariances) become free parameters of the rotated model: a new internal model object is built in which they are estimated quantities with standard errors of their own. The complete unrotated solution remains accessible:
round(lavInspect(fit3, "est_unrotated")$lambda, 3) f1 f2 f3
x1 0.814 0.000 0.000
x2 0.555 0.197 0.000
x3 0.714 0.172 0.207
x4 0.577 -0.485 -0.637
x5 0.565 -0.593 -0.766
x6 0.576 -0.412 -0.574
x7 0.133 -0.663 0.363
x8 0.322 -0.510 0.424
x9 0.532 -0.305 0.296
15.6.1 The bordered information approach
The default approach treats the rotated solution as a constrained estimator. After rotation, the model has more free parameters than the data can identify: the freed user = 7 parameters add M(M-1)/2 loadings (plus, for oblique rotation, M(M-1)/2 factor covariances) per EFA set per block. But the rotated solution is not an arbitrary point in this larger space. It satisfies, by construction, the stationarity conditions of the rotation criterion. Recall from Section 15.5.1 that at convergence the projected gradient vanishes. Translated from \mathbf{T}-space to the parameter matrices, and writing
\mathbf{Z} = \boldsymbol{\Lambda}^{\prime} \, \mathbf{G}_q, \qquad \mathbf{G}_q = \frac{\partial Q}{\partial \boldsymbol{\Lambda}} \Bigg|_{\boldsymbol{\Lambda}= \hat{\boldsymbol{\Lambda}}},
(with the row weights and standardization of Section 15.5.4 applied to \boldsymbol{\Lambda} before Q is evaluated), the conditions are:
\text{orthogonal:}\;\; \mathbf{Z} = \mathbf{Z}^{\prime} \qquad\qquad \text{oblique:}\;\; \mathbf{Z} = \mathrm{diag}(\mathbf{Z}) \, \boldsymbol{\Psi}. \tag{15.32}
The off-diagonal elements of these matrix equations provide exactly M(M-1)/2 (orthogonal) or M(M-1) (oblique) equality constraints per rotated set, precisely the number of parameters that were freed. The rotated solution is therefore an ordinary equality-constrained estimator, and its variance–covariance matrix follows from the standard theory of Section 7.7: the constraint functions are evaluated at the solution, their Jacobian is obtained numerically (central differences with Richardson extrapolation) and appended to whatever other constraints the model already has, and the variance–covariance matrix is computed from the information matrix augmented (“bordered”) with these constraint rows, hence the name. If \mathbf{A}(\hat{\boldsymbol{\vartheta}}) denotes the information matrix of the rotated model (with the freed parameters included) and \mathbf{J}_c the constraint Jacobian, the bordered matrix
\begin{pmatrix} \mathbf{A}(\hat{\boldsymbol{\vartheta}}) & \mathbf{J}_c^{\prime} \\ \mathbf{J}_c & \mathbf{0} \end{pmatrix} \tag{15.33}
is inverted, and the upper-left block (divided by N) is the vcov of the rotated parameters. The information matrix of the unconstrained rotated model is rank-deficient (again a consequence of the rotational indeterminacy), but the border restores full rank.
This formulation is compatible with all the inference methods of chapter 8: se = "robust.sem", se = "robust.huber.white", sandwich estimators for categorical data, and scaled test statistics all work unchanged, because they only require the (bordered) information matrices that the variance–covariance computation already assembles (see Section 8.4 and Section 8.4.4). This is how, for example, an EFA of ordered indicators obtains proper WLSMV-style robust standard errors for its rotated loadings. The delta method of the next section shares this property, since it transforms whatever variance–covariance matrix was computed for the unrotated parameters. What sets the bordered approach apart is that the fitted object is left in a complete state: the rotation constraints are stored with the model, so that every later computation that derives an information matrix from the fitted object, such as the modification indices of Section 10.11, works with a properly constrained, nonsingular problem.
One visible consequence: in the summary() header of a rotated model, the line Row rank of the constraints matrix reports the row rank of the complete constraint Jacobian, that is, the rotation constraints (six for three oblique factors) plus any other constraints the model carries; for an efa() fit these include the variance bounds implied by its default bounds = "pos.var", which is why the line reads 15 rather than 6 for the running example. The degrees of freedom are unaffected, since the freed parameters and the added rotation constraints cancel exactly.
15.6.2 The delta method
The second approach (rotation_se = "delta") follows Asparouhov and Muthén (2009) and treats the entire rotated solution as a function of the unrotated free parameters,
\tilde{\boldsymbol{\vartheta}}= r(\hat{\boldsymbol{\vartheta}}),
where r(\cdot) comprises setting the model matrices, rotating each EFA set, and reading off the rotated (user-level) parameters. The delta rule then gives
\widehat{\text{Var}}(\tilde{\boldsymbol{\vartheta}}) = \mathbf{J}\,\widehat{\text{Var}}(\hat{\boldsymbol{\vartheta}})\,\mathbf{J}^{\prime}, \qquad \mathbf{J} = \frac{\partial r(\boldsymbol{\vartheta})}{\partial \boldsymbol{\vartheta}^{\prime}} \Bigg|_{\boldsymbol{\vartheta}= \hat{\boldsymbol{\vartheta}}}, \tag{15.34}
with \widehat{\text{Var}}(\hat{\boldsymbol{\vartheta}}) the vcov of the unrotated parameters computed before the rotation step (of the requested se type). The Jacobian \mathbf{J} is computed numerically, and the step size is a delicate matter. On the one hand, the map r(\cdot) is only piecewise smooth (random starts, reflections and reorderings can make it jump), and a too-small step is dominated by the convergence noise of the inner rotation. On the other hand, criteria like geomin are smooth only on the scale of their smoothing constant (\epsilon = 0.001 by default), and a too-coarse step biases the standard errors of near-zero loadings. The current implementation uses central differences (with Richardson extrapolation) and a modest step size (10^{-3}), while temporarily tightening the convergence tolerances of the inner rotation (to 10^{-10}) so that the convergence noise stays well below the step. (In earlier versions, one-sided differences with a coarse step of 0.005 were used.) To keep all perturbed evaluations on the same “branch” of the rotation, the option jac_init_rot = TRUE (the default) starts each inner rotation from the fitted rotation matrix \mathbf{H} and disables the random starts inside the Jacobian computation.
The two approaches are mathematically equivalent, and should agree up to the numerical accuracy of the Jacobians involved. For the three-factor Holzinger–Swineford EFA:
fit3_delta <- efa(data = HS9, nfactors = 3, output = "lavaan",
rotation_se = "delta")
max(abs(parameterEstimates(fit3_delta)$se -
parameterEstimates(fit3)$se), na.rm = TRUE)[1] 1.605256e-07
Both approaches work with every type of se, robust and sandwich variants included, and both yield a variance–covariance matrix that lavTestWald() and the score tests can use. The bordered approach is the default for two reasons. Its numerical Jacobian is that of a smooth constraint function, not of the piecewise-smooth rotation map. And it leaves a fitted object whose information matrices are consistent with the rotated parameters, whereas the delta method only transforms the variance–covariance matrix: a function that needs the information matrix of the rotated model itself, such as modindices(), finds it rank-deficient under the delta method and stops with an error.
15.6.3 Bootstrap standard errors
When se = "bootstrap" is combined with a rotated model, neither analytic route applies; instead, the rotation step uses a dedicated bootstrap procedure for EFA models. Each bootstrap sample is refitted from the unrotated model and rotated from scratch. This creates an alignment problem: the rotated factors of a bootstrap replication may appear in a different order or with different signs than in the original sample, and naively computing the variance across replications would be meaningless. lavaan therefore finds, for each replication, the signed permutation matrix that best matches the replication’s rotated loadings to the original rotated loadings (in the least-squares sense; for a bifactor rotation the general factor keeps its position and is only sign-aligned), and applies it (via Equation 15.31, since a signed permutation is itself an orthogonal rotation) before the replication enters the bootstrap vcov. Failed replications are dropped and non-admissible ones are kept but counted, each with a warning, as in Section 8.4.12.
Standard errors of any type for rotated loadings should be interpreted with the local-minima problem in mind. All three methods quantify the sampling variability of the solution defined by the rotation criterion, assuming the same local optimum would be found in every (bootstrap or population) sample. When the criterion has several local minima whose ordering changes across samples, the reported standard errors can be a poor summary of the actual instability; the aligned bootstrap is then the most informative of the three, but even it cannot repair a fundamentally ill-determined rotation.
15.7 The efa() function
While EFA models can be specified directly in sem() (as we do for ESEM in Section 15.8), the dedicated efa() function offers an interface that mimics classic EFA software such as the factor analysis functions of base R and the psych package. Its main arguments are the data (data, or sample_cov with sample_nobs), the number of factors (nfactors), the rotation method and its options (rotation), the variable names (ov_names), the bounds (bounds, default "pos.var") and the type of output (output); see ?efa for the full signature. The function performs three tasks. First, it determines the variable names (from ov_names, or all columns of data, or the row/column names of sample_cov; group, cluster and sampling-weight variables are excluded automatically) and the block structure (groups \times levels). Second, for each requested number of factors, it generates model syntax; for a single block with two factors and three indicators this is
efa("efa")*f1 =~ x1 + x2 + x3
efa("efa")*f2 =~ x1 + x2 + x3i.e., every factor loads on every indicator, and all factors belong to one EFA block labeled "efa". Third, it calls sem() with this syntax and the user’s remaining arguments (... is passed through, so estimator, group, cluster, ordered, missing, se, and so on all work).
Some practical notes on the arguments:
nfactorsmay be a single number, a vector (e.g.,nfactors = 1:4), or a list with one element per candidate model, each element giving a per-block vector of factor counts, so that a two-level or multigroup EFA can extract a different number of factors in each block (e.g.,nfactors = list(c(2, 1))for two within-level and one between-level factor).sample_covmay be a covariance or a correlation matrix. Unlikesem()andcfa(),efa()recognizes a correlation matrix (all variances equal to one) and, unless acorrelationargument is given, analyzes it as a correlation structure (correlation = TRUE, Section 12.5), which yields the standard errors appropriate for a correlation matrix; the loadings and the fit measures are the same as for a covariance matrix. Setcorrelation = FALSEto analyze it as a covariance matrix instead.sample_nobssupplies the sample size.rotationaccepts either a method name or a list whose first element is the method name and whose remaining (named) elements are rotation options (Section 15.5.6), e.g.rotation = list("geomin", geomin_epsilon = 0.01, rstarts = 100).output = "efa"(default) returns an object of classefaList;output = "lavaan"returns the underlying lavaan object (only possible for a singlenfactorsvalue); we used this repeatedly above.
An efaList is a plain list of lavaan objects (named nf1, nf2, …), with one extra element, loadings, holding the standardized loading matrices so that the loadings() function of base R works on it. The methods print(), summary() and fitMeasures() are provided. fitMeasures() returns one column per candidate model, which is the quickest way to compare factor counts:
fit_all <- efa(data = HS9, nfactors = 1:3)
fitMeasures(fit_all, c("chisq", "df", "pvalue", "cfi", "rmsea", "aic",
"bic")) nfct=1 nfct=2 nfct=3
chisq 312.264 130.306 22.897
df 27.000 19.000 12.000
pvalue 0.000 0.000 0.029
cfi 0.677 0.874 0.988
rmsea 0.187 0.140 0.055
aic 7738.448 7572.491 7479.081
bic 7805.176 7668.876 7601.416
15.7.1 The summary output
The summary() method assembles, per candidate model, a display in the style of traditional EFA programs:
summary(fit_all, nd = 3L, cutoff = 0.3, dot_cutoff = 0.1)This is lavaan 0.7-4 -- running exploratory factor analysis
Estimator ML
Rotation method Geomin oblique
Geomin epsilon 0.001
Rotation algorithm (rstarts) GPA (30)
Standardized metric TRUE
Row weights None
Number of observations 301
Overview models:
aic bic sabic chisq df pvalue cfi rmsea
nfactors = 1 7738.448 7805.176 7748.091 312.264 27 0.000 0.677 0.187
nfactors = 2 7572.491 7668.876 7586.418 130.306 19 0.000 0.874 0.140
nfactors = 3 7479.081 7601.416 7496.758 22.897 12 0.029 0.988 0.055
Eigenvalues correlation matrix:
ev1 ev2 ev3 ev4 ev5 ev6 ev7 ev8 ev9
3.216 1.639 1.365 0.699 0.584 0.500 0.473 0.286 0.238
Number of factors: 1
Standardized loadings: (* = significant at 1% level)
f1 unique.var communalities
x1 0.438* 0.808 0.192
x2 .* 0.951 0.049
x3 .* 0.950 0.050
x4 0.848* 0.281 0.719
x5 0.841* 0.293 0.707
x6 0.838* 0.298 0.702
x7 .* 0.967 0.033
x8 .* 0.960 0.040
x9 0.307* 0.906 0.094
f1
Sum of squared loadings 2.586
Proportion of total 1.000
Proportion var 0.287
Cumulative var 0.287
Number of factors: 2
Standardized loadings: (* = significant at 1% level)
f1 f2 unique.var communalities
x1 .* 0.430* 0.673 0.327
x2 . .* 0.906 0.094
x3 0.456* 0.783 0.217
x4 0.851* 0.274 0.726
x5 0.868* 0.264 0.736
x6 0.825* 0.302 0.698
x7 0.448* 0.802 0.198
x8 0.627* 0.630 0.370
x9 0.734* 0.458 0.542
f1 f2 total
Sum of sq (obliq) loadings 2.280 1.629 3.909
Proportion of total 0.583 0.417 1.000
Proportion var 0.253 0.181 0.434
Cumulative var 0.253 0.434 0.434
Factor correlations: (* = significant at 1% level)
f1 f2
f1 1.000
f2 0.339* 1.000
Number of factors: 3
Standardized loadings: (* = significant at 1% level)
f1 f2 f3 unique.var communalities
x1 0.611* . 0.513 0.487
x2 0.534* . 0.749 0.251
x3 0.705* 0.543 0.457
x4 0.844* 0.279 0.721
x5 0.895* 0.243 0.757
x6 0.810* 0.305 0.695
x7 . 0.775* 0.502 0.498
x8 0.744* 0.469 0.531
x9 0.312* 0.481* 0.543 0.457
f2 f3 f1 total
Sum of sq (obliq) loadings 2.215 1.343 1.297 4.855
Proportion of total 0.456 0.277 0.267 1.000
Proportion var 0.246 0.149 0.144 0.539
Cumulative var 0.246 0.395 0.539 0.539
Factor correlations: (* = significant at 1% level)
f1 f2 f3
f1 1.000
f2 0.373* 1.000
f3 0.432* 0.306* 1.000
All quantities in this output come from the standardized solution (lavTech(fit, "std"); see Section 12.1). Reading it from the top:
The header reports the estimator, the rotation method and its key settings (criterion constant, algorithm, number of random starts,
std_ov, row weights).The model overview table shows, for each number of factors, the information criteria, the chi-square test, CFI and RMSEA (their scaled/robust versions when available; see Section 10.2). Here the three-factor model is the only one with an acceptable fit.
The eigenvalues are those of the unrestricted (\mathsf{H}_1) sample correlation matrix (covariance matrix if
std_ov = FALSE), the input for classic heuristics such as the Kaiser–Guttman “eigenvalues greater than one” rule (Guttman, 1954) or the scree plot.The standardized loadings table suppresses loadings below
cutoff(default 0.3) and prints loadings betweendot_cutoff(default 0.1) and the cutoff as a dot, so the simple structure is immediately visible; significance stars (alpha_level, default 0.01) are based on the standard errors of Section 15.6. The last two columns give the unique variances and communalities.The sum-of-squares table generalizes the “variance explained” table of orthogonal EFA to the oblique case: the sums of squares are the diagonal elements of \boldsymbol{\Psi}\boldsymbol{\Lambda}^{\prime} \boldsymbol{\Lambda}, which reduce to column sums of squared loadings when \boldsymbol{\Psi}= \mathbf{I}, and always add up to the total communality. Factors are shown in decreasing order.
The factor correlations are the \boldsymbol{\Psi} matrix of the oblique solution (omitted for orthogonal rotation and single-factor models).
Additional switches include se, zstat and pvalue (add tables of standard errors and test statistics for the standardized loadings), lambda_structure (the factor structure matrix \boldsymbol{\Lambda}\boldsymbol{\Psi}, i.e. the correlations between indicators and factors), and fs_determinacy (the determinacy of regression factor scores; see Section 13.2.5).
Since each element of the efaList is a full lavaan object, everything from chapter 9 applies: fit_all$nf3 can be passed to parameterEstimates(), lavInspect(), lavResiduals(), modindices(), and so on.
15.7.2 Choosing the rotation: geomin versus varimax
To make the role of the criterion concrete, we compare the default oblique geomin solution with the classic orthogonal varimax solution for the three-factor model:
fit_geomin <- fit3 # from above
fit_varimax <- efa(data = HS9, nfactors = 3, rotation = "varimax",
output = "lavaan")
round(lavInspect(fit_geomin, "std")$lambda, 3) f1 f2 f3
x1 0.611 0.170 0.012
x2 0.534 0.033 -0.141
x3 0.705 -0.094 0.002
x4 0.009 0.844 0.004
x5 -0.083 0.895 0.009
x6 0.069 0.810 -0.015
x7 -0.255 0.010 0.775
x8 0.011 -0.074 0.744
x9 0.312 -0.002 0.481
round(lavInspect(fit_varimax, "std")$lambda, 3) f1 f2 f3
x1 0.623 0.277 0.152
x2 0.490 0.105 -0.027
x3 0.663 0.034 0.130
x4 0.165 0.827 0.099
x5 0.087 0.861 0.091
x6 0.212 0.801 0.089
x7 -0.073 0.090 0.696
x8 0.162 0.051 0.709
x9 0.406 0.132 0.524
Both rotations recover the expected visual/textual/speed structure, but the geomin cross-loadings are visibly closer to zero: when the factors are forced to be uncorrelated, the (substantial) factor correlations can only be represented through the loadings, which inflates the cross-loadings. The factor correlations of the oblique solution quantify what varimax suppresses:
round(lavInspect(fit_geomin, "std")$psi, 3) f1 f2 f3
f1 1.000
f2 0.373 1.000
f3 0.432 0.306 1.000
Both models fit identically (same \hat{\boldsymbol{\sigma}}, same chi-square); the choice between them is a choice about the representation, not about fit. This holds for every pair of rotations: since all rotated solutions fit identically, fit measures can never validate a rotation. The choice of criterion is a substantive commitment, and reporting it together with its settings is part of a reproducible EFA or ESEM analysis. As noted in Section 15.5.7, these correlations equal \mathbf{H}^{\prime}\mathbf{H}, with \mathbf{H} the rotation matrix of the block, as returned by lavInspect(fit_geomin, "rotation_matrix").
15.8 Exploratory SEM
All of the above also applies when the EFA block is only part of a model. This is the essence of exploratory structural equation modeling (Asparouhov & Muthén, 2009; Marsh et al., 2014): measurement blocks without a hypothesized loading pattern are specified as EFA sets, while the rest of the model (confirmatory factors, regressions among factors, covariates, mean structures) is specified as usual.
15.8.1 Syntax
An EFA set is declared with the efa("label")* modifier on the left-hand side of the =~ operator (the only left-hand-side modifier in the lavaan syntax; see Section 2.3.7). All factors sharing the same label form one set, are identified with one echelon pattern, and are rotated together; factors with different labels are rotated separately (a “set-ESEM”); factors without the modifier are confirmatory and are not rotated at all. For example:
model <- '
# exploratory block
efa("blk")*f1 =~ y1 + y2 + y3 + y4 + y5 + y6
efa("blk")*f2 =~ y1 + y2 + y3 + y4 + y5 + y6
# confirmatory factor
g =~ y7 + y8 + y9
# structural part
g ~ f1 + f2 + x1
'
fit <- sem(model, data = mydata, rotation = "geomin")Internally, the parser stores the label in the efa column of the parameter table; the identification restrictions are added per set (Section 15.2.2); the model matrices track which observed and latent variables belong to which set; and after estimation, the rotation step rotates each set and transforms all affected parameters via Equation 15.31. Regression coefficients pointing to or from EFA factors are part of \mathbf{B} and are rotated along; covariances between EFA factors and other (confirmatory) factors are part of \boldsymbol{\Psi} and are rotated as well. Regressions among the factors of one EFA block are the exception: the relations among the factors of a block are determined by the rotation, not by the data, so a coefficient such as f2 ~ f1 with both factors in the same block is not identified and has no meaning, and lavaan warns when it finds one. Regressions between an EFA factor and a factor outside the block, or an observed variable, are allowed. The rotation argument works exactly as in efa(): a method name from Section 15.4, or a list with the method name followed by the rotation options of Section 15.5.6, as in rotation = list("geomin", rstarts = 100). The standard error methods of Section 15.6 apply unchanged as well.
15.8.2 An ESEM version of the Holzinger–Swineford model
The natural ESEM counterpart of the classic three-factor CFA frees all cross-loadings:
model_esem <- '
efa("blk")*visual =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
efa("blk")*textual =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
efa("blk")*speed =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
'
fit_esem <- sem(model_esem, data = HolzingerSwineford1939)
model_cfa <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
fit_cfa <- cfa(model_cfa, data = HolzingerSwineford1939)This ESEM model is identical to the three-factor efa() model of Section 15.7; only the factor names differ. The CFA is nested in it: fixing the twelve freed cross-loadings (net of the rotational indeterminacy) to zero recovers the confirmatory model, so a likelihood ratio test (see Section 11.2) is available:
lavTestLRT(fit_esem, fit_cfa)Chi-Squared Difference Test
Df AIC BIC Chisq Chisq diff RMSEA Df diff Pr(>Chisq)
fit_esem 12 7479.1 7601.4 22.897
fit_cfa 24 7517.5 7595.3 85.305 62.409 0.11814 12 8.184e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The zero cross-loading hypothesis is clearly rejected for these data. The practical consequence of forcing the cross-loadings to zero is the same as for varimax: inflated factor correlations. Compare
round(lavInspect(fit_esem, "est")$psi, 3) visual textul speed
visual 1.000
textual 0.373 1.000
speed 0.432 0.306 1.000
round(lavInspect(fit_cfa, "std")$psi, 3) visual textul speed
visual 1.000
textual 0.459 1.000
speed 0.471 0.283 1.000
The CFA overestimates the visual–textual correlation (0.459 versus 0.373) because the suppressed cross-loadings can only be accommodated by the factor correlation. This is the pattern that motivated ESEM (Asparouhov & Muthén, 2009).
A more elaborate ESEM combines an EFA block with a confirmatory factor and a structural regression, including an observed covariate:
model_esem2 <- '
# exploratory measurement block
efa("blk")*f1 =~ x1 + x2 + x3 + x4 + x5 + x6
efa("blk")*f2 =~ x1 + x2 + x3 + x4 + x5 + x6
# confirmatory measurement block
speed =~ x7 + x8 + x9
# structural part
speed ~ f1 + f2 + ageyr
'
fit_esem2 <- sem(model_esem2, data = HolzingerSwineford1939)The summary output (not shown) labels the exploratory factors with their block label (f1 =~ blk); the regression slopes of speed on the two exploratory factors are estimated as 0.202 (SE 0.055) and 0.163 (SE 0.049), with their standard errors correctly reflecting the rotation, since \mathbf{B} was transformed by Equation 15.31 and the bordered vcov covers all parameters jointly.
15.9 Rotation in multiple groups
Rotation becomes a more delicate matter as soon as the same exploratory model is fitted in several groups. The unrotated solution of each group is identified by its own echelon pattern, and the rotation of each group is a separate choice, so the question arises how the rotated solutions of the groups should relate to each other. Three perspectives can be taken, and lavaan supports all three.
Every group is rotated independently. The rotation criterion is minimized in each group separately, so that every group’s loading matrix is as simple as the criterion allows, with no regard for the other groups.
Every group is rotated the same way. The loadings are constrained to be equal across groups (
group_equal = "loadings"), a single rotation applies to all groups, and the agreement between the groups is maximal: the loading matrices are identical.A compromise between the two. All groups are rotated jointly to minimize a weighted sum of the simplicity criteria of the groups and a measure of the disagreement between their loading matrices, with a weight that moves the solution from the first perspective towards the second (
mg_agreement = TRUE).
The first perspective is the default. The second is the metric invariance model of the confirmatory tradition, and the third is a recent development that lies between them: a framework that contains the multigroup factor rotation of De Roover and Vermunt (2019) and the alignment method of Asparouhov and Muthén (2014) as special cases, the latter also for confirmatory models. The three perspectives are discussed in turn, followed by these two special cases and by the invariance analysis of the aligned parameters. Throughout, the running example is the three-factor ESEM of the Holzinger–Swineford data, fitted in the two schools:
model_mg <- '
efa("blk")*f1 =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
efa("blk")*f2 =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
efa("blk")*f3 =~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
'Multiple levels are treated like multiple groups for the first perspective only: each level of a two-level EFA is a block with its own echelon pattern and its own rotation. The second and third perspectives are about groups.
15.9.1 Independent rotation
By default, every block is rotated independently: each group has its own rotation matrix \mathbf{H}_g, chosen to minimize the criterion for that group’s unrotated loadings, with its own random starts, its own sign reflections and its own column ordering (Section 15.5.5). This is the ESEM analog of a configural model: the loading patterns are free to differ across groups, and nothing ties the rotations together.
fit_config <- sem(model_mg, data = HolzingerSwineford1939,
group = "school")
est_c <- lavInspect(fit_config, "est")
lavInspect(fit_config, "rotation_criterion")$Pasteur
blk
0.2170615
$`Grant-White`
blk
0.224288
max(abs(est_c[[1]]$lambda - est_c[[2]]$lambda))[1] 0.4566371
Each group reaches the lowest criterion value it can, and the loading matrices differ noticeably between the two schools. Two points should be kept in mind when the group solutions are compared. First, even with identical population loadings, the group-specific rotations need not coincide in finite samples: sampling variability in the unrotated loadings propagates to the rotation, and the differences between the rotated loading matrices then exaggerate the differences in the populations. Second, since the reflection and ordering conventions are applied per group, nothing guarantees that column m of one group is the same factor as column m of another group. For a clean three-factor structure the ordering rule will usually agree across groups (as it does here; see lavInspect(fit_config, "lv_order")), but for a less clear-cut structure the columns of one group may be permuted or reflected relative to another, and the user has to check and, if needed, reorder the factors by hand before comparing them (the side-by-side tables of lavCompareGroups(), introduced in Section 15.9.3, are the natural tool for this check). The independent rotation is the right choice when the groups are analyzed in their own right, or as a first look at whether the same structure emerges in every group.
15.9.2 Equal rotation under loading invariance
The opposite perspective constrains the loadings to be equal across groups, with group_equal = "loadings" as in the confirmatory case (see Section 3.2.8). For EFA sets this has two effects. First, lavaan detects that the loadings are constrained equal across groups and skips the echelon restrictions in all but the first group (marking those entries user = 77 instead of 7; see Section 3.2.2): the cross-group equality constraints themselves remove the extra rotational indeterminacy, so that only one set of M(M-1)/2 identification restrictions is needed for the whole model. Second, the rotation step computes a single rotation matrix from the first group’s loading matrix and applies it to every group, so the (equal) loadings remain equal after rotation, while each group keeps its own rotated factor covariance matrix \boldsymbol{\Psi}_g (with the factor variances fixed to one in the first group only, as in a confirmatory metric invariance model). Because the single rotation is determined by the first group, the model is only rotation invariant if the factor covariance matrices of the other groups are completely free: lavaan therefore frees them even when an orthogonal rotation is requested (orthogonal = TRUE then applies to the first group only). To impose the same factor covariance matrix in all groups, add both "lv.variances" and "lv.covariances" to group_equal; a warning is given if only one of the two is present. Agreement between the groups is maximal by construction, and the comparison with the independent rotation is the usual test of metric invariance:
fit_metric <- sem(model_mg, data = HolzingerSwineford1939,
group = "school", group_equal = "loadings")
est_m <- lavInspect(fit_metric, "est")
c(configural = max(abs(est_c[[1]]$lambda - est_c[[2]]$lambda)),
metric = max(abs(est_m[[1]]$lambda - est_m[[2]]$lambda)))configural metric
0.4566371 0.0000000
lavTestLRT(fit_config, fit_metric)Chi-Squared Difference Test
Df AIC BIC Chisq Chisq diff RMSEA Df diff Pr(>Chisq)
fit_config 24 7445.9 7757.3 29.333
fit_metric 42 7434.2 7678.8 53.626 24.293 0.048197 18 0.1457
Metric invariance is not rejected for these data. Higher levels of invariance (intercepts, residuals) are requested exactly as in the confirmatory case, via group_equal = c("loadings", "intercepts") and so on. Note that the likelihood ratio test compares the unrotated models, and does not depend on the rotation at all; what the rotation adds is a common, interpretable loading matrix for all groups. Partial loading invariance, with some loadings of an EFA set free in some groups, is not possible within this framework: the echelon logic needs either all or none of the loadings of a set to be constrained (Section 15.2.2).
15.9.3 Rotation with agreement: the compromise
The third perspective, multigroup rotation with agreement, is enabled by the rotation option mg_agreement = TRUE. It was inspired by the multigroup factor rotation of De Roover and Vermunt (2019), and it has since grown into a general framework in which all groups are rotated jointly, so that the loading matrices are both simple and similar across groups, with a weight that sets the balance between the two goals. Two well-known methods are special cases of this framework: the multigroup factor rotation itself (Section 15.9.4) and the alignment method of Asparouhov and Muthén (2014) (Section 15.9.5). This section describes the framework; its options are collected in Table 15.3. The procedure has three stages.
First, every group is rotated on its own, with the rotation criterion, the random starts and the standardization (std_ov) of the single-group case (rstarts acts here and, in the scales-only mode described below, on the minimization over the scales; the joint rotation itself starts from a single point), and the columns of groups 2, \ldots, G are permuted to match the reference group (the first group by default) as closely as possible, by the permutation that minimizes the root mean squared difference with its loadings (the general factor of a bifactor rotation stays in place). The joint rotation thus starts from a point where every group is already at a minimum of its own criterion, and only the agreement term moves the solution.
Second, the joint objective is minimized. Differences in the scale of a factor across groups must not count as disagreement, so the objective is evaluated on column-rescaled loading matrices \tilde{\boldsymbol{\Lambda}}_g = \boldsymbol{\Lambda}_g \mathbf{D}_g, with \mathbf{D}_g a diagonal matrix of scale factors, one per factor and group, chosen such that the factors have unit variance on average over the groups. How these scale factors are determined is the subject of the mg_agreement_scales option, discussed below. The objective is
F = (1 - w) \sum_{g=1}^{G} \omega_g \, Q(\tilde{\boldsymbol{\Lambda}}_g) \; + \; w \sum_{g < h} \omega_g \, \omega_h \, A\bigl(\tilde{\boldsymbol{\Lambda}}_g, \tilde{\boldsymbol{\Lambda}}_h\bigr) , \tag{15.35}
where Q is the usual simplicity criterion, A is a measure of the disagreement between the loading matrices of two groups, the weight w (mg_agreement_weight, default 0.5) balances within-group simple structure against between-group similarity, and the \omega_g are group weights. Three disagreement measures are available (mg_agreement_method):
"procrustes"(the default): the sum of squared differences, A = \| \tilde{\boldsymbol{\Lambda}}_g - \tilde{\boldsymbol{\Lambda}}_h \|^2 with \| \cdot \| the Frobenius norm, a generalized procrustes measure. Every difference counts in proportion to its square."loading.alignment": the component loss of the alignment method (Asparouhov & Muthén, 2014),A = \sum_{p,m} f\bigl(\tilde{\lambda}_{g,pm} - \tilde{\lambda}_{h,pm}\bigr), \qquad f(x) = \left( x^2 + \epsilon \right)^{1/4}, \tag{15.36}
with \epsilon the option
mg_agreement_epsilon(default 0.01). Compared with the square, this loss penalizes small differences more than proportionally and large differences less, so that the solution has many (nearly) invariant loadings and a few large differences, rather than many small ones."relative.alignment": the same loss applied to relative differences. A loading enters as \tfrac{1}{2}\log(\lambda^2 + \epsilon), so that the difference between two groups is the log ratio of their loadings (damped to zero for loadings near zero), and an intercept difference is divided by the scale of its indicator. This loss is (nearly) invariant to the scale of the indicators, and it is the loss that reproduces the alignment results of Mplus.
The group weights \omega_g are all one by default (mg_agreement_group_weights = "equal"). With "nobs" they are the group sample sizes scaled to average one, so that a large group counts more in both terms; with "sqrt.nobs" they are the square roots of those, \omega_g = (n_g / \bar{n})^{1/2} with \bar{n} the average sample size, so that a pair of groups is weighted by \sqrt{n_g n_h} (divided by \bar{n}), the pair weight of the alignment method.
The scale factors in \mathbf{D}_g are determined in one of two ways (mg_agreement_scales). With "equal" (the default), every column of every group is rescaled to the group-average sum of squares: the scale factor for factor m in group g is (\bar{s}_m / s_{gm})^{1/2}, with s_{gm} = \sum_p \lambda_{g,pm}^2 and \bar{s}_m its average over the groups. The rule fixes the split of the scale of each factor over the groups by a quantity the criterion cannot manipulate: a group’s factor variance then measures how much larger its column was with a unit-variance factor, and the loadings are compared across groups up to scale, through their congruence. With "free", the split is part of the objective: the scale factors are additional unknowns, subject only to the identification constraint on the overall scale of each factor (a mean factor variance of one across groups by default; see below), and the criterion chooses how the variance of a factor is distributed over the groups. This is the choice of the multigroup factor rotation (Section 15.9.4). The free split is only well defined for criteria that stay bounded when the loadings of a factor are scaled up (quartimin, oblimin with \gamma = 0, geomin, the Crawford–Ferguson family, the target criteria, simplimax and the bifactor criteria); for the orthomax family, only the agreement term keeps the scales finite, and lavaan does not accept the combination. How the overall scale of a factor is identified is a separate choice (mg_agreement_identification): the factor variances average to one across groups ("mean", the default), have a product of one ("product"), or equal one in the reference group ("reference", the convention of the alignment method; with free scales this is the product solution re-expressed in the metric of the reference group).
The intercepts can be aligned along with the loadings (mg_agreement_intercepts). With "fixed" or "free", the factor means \mathbf{a}_g of the EFA factors become additional unknowns of the objective (zero in the reference group under "fixed"; free in every group under "free", which needs more than two groups and some non-invariance to be identified), and the aligned intercepts of the indicators, \tilde{\boldsymbol{\nu}}_g = \boldsymbol{\nu}_g - \tilde{\boldsymbol{\Lambda}}_g
\mathbf{a}_g, enter the agreement term with the same loss and the same pair weights as the loadings. This requires a mean structure. For ordered indicators, the thresholds take the place of the intercepts.
Finally, the joint rotation itself can be switched off (mg_agreement_rotate = FALSE): the per-group rotated patterns of the first stage are then kept as they are, and only the split of the scales (and the means, if the intercepts are aligned) is optimized. This scales-only mode is what the alignment method does; it is only useful with free scales (with equal scales nothing moves), and since the alignment loss has local optima in the scales, the minimization is restarted from rstarts random points. Two algorithms minimize the objective (mg_agreement_algorithm). The default, "gpa", is the gradient projection algorithm of Section 15.5.1 applied to the rotation matrices (and the scales and means) of all groups jointly: the Barzilai–Borwein step, the non-monotone line search and the convergence test use the stacked projected gradients of all groups, and a singular step or a collapse in any group counts for the whole problem. The alternative, "pairwise", runs the plane sweeps of Section 15.5.2 over the planes of all groups, alternating with a minimization over the scales and means; this is also the automatic choice for simplimax, which has no usable gradient. The gradients of F with respect to the loadings, the scales and the means are all available analytically, including the chain rule through the column rescaling, which couples all groups.
Third, after the joint rotation, the rotation matrices are re-expressed relative to the original unrotated matrices, the rescaling of the factors is folded into them, and they are applied to all model matrices of each group as in Equation 15.31; if the intercepts were aligned, the factors are also translated by their aligned means, which changes \boldsymbol{\alpha} and \boldsymbol{\nu} but not the model-implied moments. Factor variances different from one in the output are therefore intended: the common metric is carried by the loadings, and the group differences in scale by the factor variances. The standard errors of the rotated parameters, the group-specific factor variances and means included, are obtained by the delta method of Section 15.6.2: the constraints of the bordered approach are those of the per-group rotations, which the joint solution does not satisfy, so lavaan sets rotation_se = "delta" whenever the agreement rotation applies.
The weight w moves the solution between the first two perspectives. At w = 0 the agreement term vanishes and every group minimizes its own criterion, which reproduces the independent rotation up to the column rescaling and the alignment of the factors. At w = 1 only the agreement counts and the groups are rotated to be as similar as possible, which is the closest one can get to the second perspective without constraining the loadings themselves: the unrotated loadings of the groups differ, so a rotation alone cannot make the rotated loadings equal. For the running example, the largest difference between the two loading matrices decreases steadily as w increases:
sapply(c(0.1, 0.5, 0.9), function(w) {
fit <- sem(model_mg, data = HolzingerSwineford1939, group = "school",
rotation = list("geomin", mg_agreement = TRUE,
mg_agreement_weight = w))
est <- lavInspect(fit, "est")
max(abs(est[[1]]$lambda - est[[2]]$lambda))
})[1] 0.3446665 0.2397837 0.2278402
With the default settings, the agreement rotation brings the two loading matrices visibly closer together than the independent rotation without imposing equality:
fit_agree <- sem(model_mg, data = HolzingerSwineford1939, group = "school",
rotation = list("geomin", mg_agreement = TRUE))
est_a <- lavInspect(fit_agree, "est")
c(configural = max(abs(est_c[[1]]$lambda - est_c[[2]]$lambda)),
agreement = max(abs(est_a[[1]]$lambda - est_a[[2]]$lambda)))configural agreement
0.4566371 0.2397837
round(est_a[[1]]$psi, 3) f1 f2 f3
f1 0.984
f2 0.297 1.036
f3 -0.037 0.065 0.960
Comparisons of this kind are made easier by lavCompareGroups(), which puts the measurement parameters of a multiple-group model side by side: one table per factor with the loadings of all groups (indicators in the rows, groups in the columns), or, with what = "intercepts", one table with the intercepts and thresholds of the indicators. The range of every parameter over the groups is added, and sort = TRUE orders the rows by decreasing range, so that the items that still differ after the agreement rotation stand out. For the first factor:
lavCompareGroups(fit_agree, sort = TRUE)$f1 Pasteur Grant-White range
x3 0.860 0.680 0.180
x8 0.236 0.377 0.140
x5 -0.109 0.000 0.108
x9 0.438 0.532 0.095
x6 0.149 0.055 0.094
x1 0.708 0.785 0.077
x7 -0.002 -0.030 0.028
x2 0.563 0.577 0.014
x4 0.050 0.043 0.007
For an agreement rotation, the "rotation" keyword of lavInspect() reports both the value of the joint objective and the criterion value of the per-group rotation that provided the starting point (here for the first group; the rotation matrix returned by "rotation_matrix" includes the final rescaling of the factors):
rot_a <- lavInspect(fit_agree, "rotation")[[1]]$blk
data.frame(rot_a[c("algorithm", "criterion", "group_criterion")]) algorithm criterion group_criterion
1 mg-gpa 0.5291129 0.2170615
The summary() header of such a model shows what was done to the factors, in a few lines below the rotation method: the agreement measure and weight, the treatment of the scales and the intercepts, the scale identification with the reference group, the group weights, and the preset (if any) of the next two sections. The fit is that of the configural model, since every group is still only rotated. The agreement rotation produces group solutions that are maximally comparable without imposing exact equality, and solves the alignment problem of the independent rotation at the same time, since the factors are matched across groups before the joint rotation starts. It is useful as an intermediate diagnostic between the configural and metric models when full loading invariance fails, and more generally whenever the groups are to be compared on a common set of factors.
| Option | Default | Meaning |
|---|---|---|
mg_agreement |
FALSE |
TRUE enables the agreement rotation; "mgfr" or "alignment" selects a preset that fills in the options below (Section 15.9.4, Section 15.9.5) |
mg_agreement_weight |
0.5 |
weight w of the agreement term in Equation 15.35 |
mg_agreement_method |
"procrustes" |
disagreement measure A: "procrustes", "loading.alignment" or "relative.alignment" |
mg_agreement_epsilon |
0.01 |
\epsilon of the alignment losses (Equation 15.36) |
mg_agreement_group_weights |
"equal" |
group weights \omega_g: "equal", "nobs" or "sqrt.nobs" |
mg_agreement_scales |
"equal" |
split of the scale of a factor over the groups: "equal" (equal column sums of squares) or "free" (part of the objective) |
mg_agreement_identification |
"mean" |
overall scale of a factor: variances average to one ("mean"), have product one ("product"), or equal one in the reference group ("reference") |
mg_agreement_intercepts |
"none" |
alignment of the intercepts (thresholds): "none", "fixed" (means zero in the reference group) or "free" |
mg_agreement_rotate |
TRUE |
FALSE keeps the per-group patterns and optimizes the scales (and means) only |
mg_agreement_reference_group |
1 |
the reference group (number or label): unit variance under "reference", zero means under "fixed", and the target of the factor matching |
mg_agreement_std_ov |
FALSE |
evaluate the objective on the loadings of the indicators standardized over the pooled sample |
mg_agreement_algorithm |
"gpa" |
"gpa" (joint gradient projection) or "pairwise" (plane sweeps over all groups) |
mg_agreement_preset |
"none" |
records the preset that was used ("mgfr", "alignment"); set through mg_agreement |
15.9.4 Multigroup factor rotation
The multigroup factor rotation (MGFR) of De Roover and Vermunt (2019), available in Latent GOLD, is the agreement rotation with the oblimin (quartimin) criterion, the procrustes disagreement measure, and the scales of the factors chosen by the criterion: the factor variances are free, subject to a mean of one across groups. In the terms of Table 15.3 this is mg_agreement_scales = "free" with mg_agreement_identification = "mean". The default agreement rotation of lavaan differs from MGFR in exactly one respect, the equal-column-sums-of-squares rule for the scales, and the two coincide when the MGFR optimum happens to have equal column sums of squares. A second point to keep in mind when comparing with the paper is the weight: lavaan’s oblimin criterion (Equation 15.10) is half the one used by De Roover and Vermunt, so their weight w on the agreement term corresponds to mg_agreement_weight = w / (2 - w). Their recommended equal weighting of the two criteria is therefore mg_agreement_weight = 1/3, and lavaan’s default of 0.5 corresponds to a weight of two thirds on agreement in their convention.
The preset mg_agreement = "mgfr" fills all of this in: oblimin, the procrustes measure, a joint rotation, free scales with the mean identification, equal group weights, and a weight of one third. Options given explicitly take precedence over the preset, so the weight or the criterion can still be changed, and a rotation list that names no criterion at all (rotation = list(mg_agreement = "mgfr")) takes the criterion of the preset. For the two schools:
fit_mgfr <- sem(model_mg, data = HolzingerSwineford1939, group = "school",
rotation = list("oblimin", mg_agreement = "mgfr"))
est_f <- lavInspect(fit_mgfr, "est")
round(rbind(Pasteur = diag(est_f[[1]]$psi),
`Grant-White` = diag(est_f[[2]]$psi)), 3) f1 f2 f3
Pasteur 1.018 1.051 0.908
Grant-White 0.982 0.949 1.092
The factor variances of the two groups now average to one for every factor; their split is the one that minimizes the objective. Compared with the equal-scales rotation at the same weight, the rotated patterns are practically the same, and the objective is slightly lower, as it must be, since the free split is less restricted:
fit_eq <- sem(model_mg, data = HolzingerSwineford1939, group = "school",
rotation = list("oblimin", mg_agreement = TRUE,
mg_agreement_weight = 1/3))
est_e <- lavInspect(fit_eq, "est")
max(abs(est_f[[1]]$lambda - est_e[[1]]$lambda),
abs(est_f[[2]]$lambda - est_e[[2]]$lambda))[1] 0.002429924
c(free = lavInspect(fit_mgfr, "rotation")[[1]]$blk$criterion,
equal = lavInspect(fit_eq, "rotation")[[1]]$blk$criterion) free equal
0.2497142 0.2497394
The choice between free and equal scales is conceptual rather than numerical. The free split is the true minimizer of the stated objective and reproduces published MGFR analyses, but the extra unknowns, one per factor and group, carry no information from the data (the likelihood is flat in them) and are chosen by a heuristic criterion, so that between-group differences in factor variances become partly an artefact of the rotation criterion; under invariant loadings with unequal factor variances in the population, the free split drifts further from invariance than the equal split, by moving variance between groups in exchange for simpler loadings. The equal split fixes the scale by a rule the criterion cannot manipulate, works for every criterion, and has a direct interpretation: the loadings of a factor are compared across groups up to scale, through their congruence. lavaan keeps the equal split as its default and offers the free split for replicating MGFR, or whenever the exact minimizer of the objective is wanted with a bounded criterion.
15.9.5 Alignment
The alignment method of Asparouhov and Muthén (2014) was developed for confirmatory models, as an alternative to the measurement invariance models of the confirmatory tradition. It starts from the configural model with unit factor variances and zero factor means in every group, and asks which group-specific factor variances \psi_g and means \alpha_g make the loadings and intercepts as invariant as possible, in the sense of the loss
\sum_{g < h} \sqrt{n_g n_h} \left[ \sum_p f\!\left( \frac{\lambda_{g,p}}{\sqrt{\psi_g}} - \frac{\lambda_{h,p}}{\sqrt{\psi_h}} \right) + \sum_p f\!\left( \nu_{g,p} - \frac{\lambda_{g,p}}{\sqrt{\psi_g}}\,\alpha_g - \nu_{h,p} + \frac{\lambda_{h,p}}{\sqrt{\psi_h}}\,\alpha_h \right) \right], \tag{15.37}
with f as in Equation 15.36, for each factor separately. The aligned model has the same fit as the configural model (it is a reparameterization), but it comes with comparable factor variances and means, and with loadings and intercepts that can be inspected for non-invariance (Section 15.9.6). In the “fixed” version the means of the reference group are fixed to zero; in the “free” version all means are aligned, which requires more than two groups and some non-invariance to be identified.
In the language of the previous section, alignment is the agreement rotation with the alignment loss, w = 1, free scales, the sqrt.nobs pair weights, and no joint rotation, since in a confirmatory model with one factor per indicator a rescaling of the factors is the only transformation that preserves the zero pattern. lavaan offers it in two forms: for exploratory blocks, where it is the alignment for ESEM of Asparouhov and Muthén (2023), and for confirmatory models.
For an ESEM, the preset mg_agreement = "alignment" applies the settings of Mplus: a per-group geomin rotation with geomin_epsilon = 0.01 on the standardized indicators, no joint rotation, the relative-difference loss with \epsilon = 0.01 (the default of the TOLERANCE option of Mplus) and weight one, free scales, fixed intercepts with the reference identification, the sqrt.nobs group weights, and a mean structure. For the two schools:
fit_align <- sem(model_mg, data = HolzingerSwineford1939, group = "school",
rotation = list("geomin", mg_agreement = "alignment"))
est_al <- lavInspect(fit_align, "est")
round(rbind(variances = diag(est_al[[2]]$psi),
means = drop(est_al[[2]]$alpha)), 3) f1 f2 f3
variances 0.706 1.158 2.601
means -0.046 0.626 -0.110
The first school is the reference group, with unit variances and zero means; the factor variances and means of the second school are the aligned values, estimated parameters with standard errors of their own. The loading patterns are those of the per-group geomin rotations, and the fit is that of the configural ESEM.
For a confirmatory model, alignment is requested with the top-level option alignment = "fixed" or "free". Its settings follow the pattern of the rotation argument: alignment can be a list whose first element is the type of alignment, followed by named settings (Table 15.4), as in alignment = list("fixed", method = "relative.alignment", reference_group = 2); a list without the type requests a fixed alignment. The model must be the configural model: std_lv = TRUE, a mean structure, free loadings and intercepts in every group, and no equality constraints. For the three-factor CFA of the two schools:
fit_cfa_align <- cfa(model_cfa, data = HolzingerSwineford1939,
group = "school", std_lv = TRUE, meanstructure = TRUE,
alignment = "fixed")
pe <- parameterEstimates(fit_cfa_align)
pe[pe$group == 2 & pe$lhs %in% c("visual", "textual", "speed") &
((pe$op == "~~" & pe$lhs == pe$rhs) | pe$op == "~1"),
c("lhs", "op", "est", "se", "z", "pvalue")] lhs op est se z pvalue
55 visual ~~ 1.340 0.598 2.241 0.025
56 textual ~~ 1.026 0.230 4.456 0.000
57 speed ~~ 1.539 0.379 4.065 0.000
70 visual ~1 -0.014 0.209 -0.065 0.948
71 textual ~1 0.599 0.138 4.333 0.000
72 speed ~1 -0.166 0.163 -1.019 0.308
The aligned loadings are the configural loadings divided by the square roots of the aligned factor variances, and the aligned intercepts are the configural intercepts minus the aligned loadings times the aligned means; the factor covariances, the regressions among the factors and the factor intercepts are transformed so that the model-implied moments do not change. The aligned variances and means are parameters of the aligned model, with delta-method standard errors, or bootstrap standard errors with se = "bootstrap", in which case every bootstrap sample is refitted and aligned with the same settings. The summary() header gains a block that reports the alignment, the loss and its \epsilon, the group weights, the identification with the reference group, the number of random starts and the standardization. The "rotation" keyword of lavInspect() returns the alignment information per group (the aligned variances and means, the loss value, the convergence flag and the loss values of the random starts), and "rotation_matrix" the diagonal rescaling.
alignment list.
| Option | Default | Meaning |
|---|---|---|
method |
"loading.alignment" |
the loss: "loading.alignment", "relative.alignment" (the loss that reproduces Mplus) or "procrustes" |
epsilon |
0.01 |
\epsilon in Equation 15.36 |
group_weights |
"sqrt.nobs" |
pair weights: "sqrt.nobs", "nobs" or "equal" |
identification |
"reference" |
overall scale of a factor: unit variance in the reference group ("reference"), product one ("product") or mean one ("mean") |
std_ov |
FALSE |
evaluate the loss on the loadings and intercepts of the indicators standardized over the pooled sample |
rstarts |
30 |
random starts of the loss minimization, in addition to the start at equal column sums of squares |
reference_group |
1 |
the reference group (number or label), or "auto": the fixed alignment with the smallest loss over all candidate reference groups |
A few practical remarks. Ordered indicators are handled by letting the thresholds take the place of the intercepts: every threshold enters the loss as a component attached to its indicator, and the aligned thresholds are the configural thresholds plus the aligned loadings times the aligned means; continuous and ordered indicators can be mixed, and since the loss is not invariant to the scale of the indicators, the solution depends on the parameterization of the configural model (Section 14.5.2). Exogenous covariates are allowed, with either conditional_x setting; the aligned factor means are then the intercepts of the factors given the covariates, so centering the covariates keeps them interpretable as means. A model may contain both EFA blocks and confirmatory factors: the blocks are rotated (and aligned, with the agreement rotation) first, and the confirmatory factors are aligned on the rotated model. Two diagnostics are issued as warnings. The alignment loss has local optima, and a warning is given when the best solution was reached by a single random start, in which case rstarts should be increased and the solutions compared. And a free alignment of the means may be poorly identified, since the overall level of the means of a factor is identified by the loss only: lavaan warns when the standard error of the average of the group means exceeds the largest standard error of a difference between two group means, which is the situation with few groups or little non-invariance; the fixed alignment is the remedy. Since the fixed solution depends on the reference group, reference_group = "auto" tries every group as the reference and keeps the most invariant aligned model. Multilevel models, and models in which an indicator of an aligned factor is itself a predictor or an outcome in a regression, are not supported.
15.9.6 Invariance analysis of the aligned parameters
The purpose of alignment is to find out which loadings and intercepts are invariant across groups once the factor variances and means have been accounted for. The lavTestAlignment() function implements the post-estimation invariance analysis of Asparouhov and Muthén (2014) for every aligned loading and, if the intercepts were aligned, every aligned intercept or threshold; it works for an agreement rotation of EFA blocks, for an aligned confirmatory model, and for a model with both. For every parameter, the procedure runs in three steps. First, the equality of the parameter is tested for every pair of groups with a z test, using the delta-method covariance matrix of the aligned estimates (the cross-group covariances are not zero after alignment, since the scales and means are shared); two groups are connected when the p-value exceeds p_connect (default 0.01), and the largest connected set of groups is the starting invariant set. Second, every group is tested against the average of the parameter over the invariant set, and the groups with a p-value above p_set (default 0.001) form the new set; this is repeated until the set no longer changes. Third, the average over the final invariant set, the non-invariant groups, the contribution of the parameter to the loss function, and an R^2 are reported. The R^2 is the proportion of the across-group variance of the unaligned parameter that is explained by the group differences in factor variances and means; it needs three or more groups. For the aligned CFA of the previous section:
lavTestAlignment(fit_cfa_align)Approximate measurement invariance of the aligned parameters
- pairwise p > 0.01 connects two groups
- p > 0.001 keeps a group in the invariant set
lhs op rhs average invariant noninvariant r2 contribution
1 visual =~ x1 0.859 Pasteur Grant-White NA 0.623
2 visual =~ x2 0.453 Pasteur Grant-White NA 0.359
3 visual =~ x3 0.609 Pasteur Grant-White NA 0.320
4 textual =~ x4 0.952 Pasteur Grant-White NA 0.317
5 textual =~ x5 1.034 Pasteur Grant-White NA 0.444
6 textual =~ x6 0.875 Pasteur Grant-White NA 0.372
7 speed =~ x7 0.569 Pasteur Grant-White NA 0.330
8 speed =~ x8 0.668 Pasteur Grant-White NA 0.316
9 speed =~ x9 0.562 Pasteur Grant-White NA 0.325
10 x1 ~1 4.940 Pasteur Grant-White NA 0.316
11 x2 ~1 6.095 Pasteur Grant-White NA 0.494
12 x3 ~1 2.487 Pasteur Grant-White NA 0.702
13 x4 ~1 2.783 Pasteur Grant-White NA 0.357
14 x5 ~1 4.069 Pasteur Grant-White NA 0.423
15 x6 ~1 1.919 Pasteur Grant-White NA 0.316
16 x7 ~1 4.432 Pasteur Grant-White NA 0.657
17 x8 ~1 5.581 Pasteur Grant-White NA 0.326
18 x9 ~1 5.421 Pasteur Grant-White NA 0.316
All loadings are found to be invariant across the two schools, and two intercepts are flagged in the second school. The side-by-side table of the aligned intercepts shows the same two items as the ones with the largest range over the groups:
lavCompareGroups(fit_cfa_align, what = "intercepts") Pasteur Grant-White range
x1 4.941 4.939 0.002
x2 5.984 6.207 0.223
x3 2.487 2.004 0.483
x4 2.823 2.743 0.080
x5 3.995 4.144 0.148
x6 1.922 1.916 0.006
x7 4.432 4.012 0.421
x8 5.563 5.600 0.037
x9 5.418 5.423 0.006
The result of lavTestAlignment() is a data frame with one row per parameter; the matrices of p-values and of set membership (parameters by groups) are attached as attributes. Two differences from the Mplus implementation are worth knowing: for an ESEM, lavaan tests all loadings of the block, cross-loadings included, and the undocumented rules by which Mplus stabilizes the iterations are replaced by a simple one (a cycle keeps the current set).
15.10 Implementation notes
This section collects details that are tied to the current implementation of lavaan (the R package, version 0.7-4) rather than to the concepts of the main text. Internal file and function names may change or move at any release, while everything reachable through the user interface stays put. Table 15.5 maps the EFA/ESEM pipeline of this chapter to its source files.
| Topic | File(s) |
|---|---|
EFA constraints in the parameter table (echelon pattern): lav_pt_efa_con(), triggered by auto_efa = TRUE; also skips the echelon zeros in all but the first group under group_equal = "loadings" (and frees the factor variances and covariances of those groups), and stops with an error when a factor lacks indicators for its zeros |
lav_partable_efa.Rlav_partable_flat.R |
unrotated solution: concentrated likelihood (lav_efa_extraction(), with corner = TRUE for the echelon pattern), PACE (lav_efa_pace(), theta_only = FALSE for a full loading matrix) |
lav_efa_extraction.Rlav_efa_pace.R |
rotation criteria: one function lav_mat_rotate_<name>() per criterion, returning Q and (on request) its gradient; the simplimax_k option and its default P(M-1) date from November 2026 (earlier versions of the 0.7-3 series fixed k = P) |
lav_matrix_rotate_methods.R |
rotation driver lav_mat_rotate() (row weights, random starts, reflection and ordering; keep_rep = TRUE keeps the value, the iterations, the convergence flag and the rotation matrix of every random start, which is what the "rotation_starts" keyword returns); GPA lav_mat_rotate_gpa() (after the code of Bernaards and Jennrich); pairwise algorithm lav_mat_rotate_pairwise() on the shared plane-sweep engine lav_mat_rotate_pairwise_core() (closed-form planes, secant search, derivative-free fallback with optimize(), sweep extrapolation; returns the number of evaluations and extrapolations) |
lav_matrix_rotate.R |
random start matrices lav_mat_rotate_gen(); Cureton–Mulaik weights lav_mat_rotate_cm_weights(); registries lav_mat_rotate_is_smooth() (FALSE for simplimax) and lav_mat_rotate_is_plane_quartic() (criteria with the closed-form plane of Equation 15.29); promax: varimax step stats::varimax(), procrustes step lav_mat_rotate_promax() (a trimmed copy of stats::promax()) |
lav_matrix_rotate_utils.R |
factor ordering rules lav_efa_order_idx() (general_first = TRUE pins the first column for the bifactor rotations); signed-permutation alignment of bootstrap replications lav_efa_align_signed_perm(); syntax generation for efa() (lav_syntax_efa()) |
lav_efa_utils.R |
rotating all groups/blocks of a fitted model: driver lav_model_efa_rotate(), application of \mathbf{H} to the model matrices lav_model_efa_apply_hg(), the rotation as a function of the parameter vector lav_model_efa_rotate_x(), and the border constraints lav_model_efa_rotate_border_x() |
lav_model_efa.R |
rotated standard errors (post-estimation); both the border Jacobian and the delta-method Jacobian are computed with numDeriv::jacobian() (Richardson extrapolation; method.args = list(d = 1e-3, r = 2) for the delta method); the vcov from the bordered information matrix is assembled by lav_model_vcov() |
lav_lavaan_step16_rotation.Rlav_model_vcov.R |
multiple-group agreement rotation: lav_mat_rotate_mg() (per-group initialization, matching, dispatch), joint GPA lav_mat_rotate_gpa_mg(), plane sweeps lav_mat_rotate_pairwise_mg(), scales-only mode lav_mat_rotate_scales_mg(); the objective and its gradients lav_mat_rotate_mg_agreement() (procrustes term in closed form; alignment losses; intercept terms); the presets are resolved in lav_options.R. All of this dates from November 2026 (the 0.7-3 series): the plane sweeps were rewritten and the joint GPA became the default (earlier versions used a derivative-free search per plane, started the oblique agreement sweep from an identity factor correlation matrix, and had no group weights), and the loss functions, free scales, intercept alignment, identification and preset options, and the delta-method standard errors for the agreement rotation were added in the days that followed |
lav_matrix_rotate_mg.Rlav_matrix_rotate_methods.Rlav_options.R |
confirmatory alignment (alignment; its settings are stored in the alignment.args sublist of the options, which is also still accepted as an argument): the aligned latent variables and checks, the alignment map used for the estimates and the delta-method Jacobian, and the translation of the factors by their aligned means lav_model_efa_apply_translation(); the invariance analysis lavTestAlignment() and the side-by-side tables of lavCompareGroups() (all new in November 2026) |
lav_model_align.Rlav_model_efa.Rlav_test_alignment.Rlav_compare_groups.R |
| bootstrap for rotated solutions | lav_efa_bootstrap.R |
the efa() function (interface modeled on factanal() and psych::fa()); summary and print methods |
xxx_efa.Rlav_efa_summary.Rlav_efa_print.R |
option handling: the rotation options are stored in the rotation.args sublist of the options (visible in lavInspect(fit, "options")), where defaults are filled in and checks are applied; the older rotation_args argument, a separate list of options, is still accepted and merged into this sublist (efa() issues a deprecation warning; sem() and lavaan() accept it silently) |
lav_options.Rlav_options_default.Rxxx_efa.R |
The per-block rotation matrices \mathbf{H} of Section 15.5.7 are stored in the H slot of the internal model object (fit@Model@H, one matrix per block), and the accompanying column permutations in fit@Model@lv.order; the per-set information served by the "rotation" keyword of lavInspect() is collected during the rotation and stored in the internal slot of the fitted object. The model object also records which observed and latent variables belong to which EFA set (@Model@ov.efa.idx, @Model@lv.efa.idx), and the numerical Jacobian of the rotation border constraints of Section 15.6 is stored in @Model@ceq.efa.JAC, appended to the other constraint rows in @Model@con.jac.
One computation of the main text can be reproduced with an internal routine. The concentrated ML extraction of Section 15.3, applied to the sample covariance matrix of the nine Holzinger and Swineford indicators, gives (almost to three decimals) the fitted unrotated \boldsymbol{\Lambda} of Section 15.2.2:
out <- lavaan:::lav_efa_extraction(s = cov(HS9), nfactors = 3,
method = "ML", corner = TRUE)
round(out$LAMBDA, 3) [,1] [,2] [,3]
[1,] 0.815 0.000 0.000
[2,] 0.556 0.198 0.000
[3,] 0.716 0.173 0.208
[4,] 0.578 -0.485 -0.638
[5,] 0.566 -0.594 -0.767
[6,] 0.577 -0.413 -0.575
[7,] 0.133 -0.664 0.364
[8,] 0.322 -0.511 0.425
[9,] 0.533 -0.305 0.296