17  Multi-stage estimators

$$

$$

The estimators of chapter 7 minimize a single discrepancy function between the observed and the model-implied moments, and every free parameter is found jointly by an iterative optimizer. This chapter describes a second family of estimators that takes a different route. A multi-stage estimator obtains one class of parameters at a time: the directed effects (factor loadings and regression coefficients) in a first stage, the undirected effects (variances and covariances) in a second stage, and the mean-structure parameters in a third. Each stage has a closed-form solution, so the estimator as a whole is non-iterative, or nearly so.

Three such estimators are available in lavaan, and they share most of their code: the instrumental-variable estimator (estimator = "IV"), the James-Stein estimators (estimator = "JS" and "JSA"), and the multiple-group method (estimator = "MGM"). They differ only in their first stage, that is, in how they obtain the directed effects without an optimizer. Everything that follows the first stage is common: the estimation of the variances and covariances, the treatment of the mean structure, equality constraints and multiple groups, the delta-method standard errors, the residual-based test statistic, and the handling of missing data.

The multi-stage estimators are not the only way to avoid a joint fit of all the parameters. The structural-after-measurement (SAM) approach of chapter 18 has the same starting point: the estimates in one part of the model should not depend on the other parts. But SAM divides the model differently. It estimates the measurement part first, block by block, and the structural part afterwards, given the measurement part. A multi-stage estimator does not set the measurement part apart: the factor loadings and the structural regression coefficients are obtained together, in the first stage. A model fitted with one of the estimators of this chapter is therefore not a SAM analysis. The two approaches can be combined, however, because the measurement blocks of a SAM analysis can be fitted with a multi-stage estimator; Section 17.7 returns to this.

This chapter is organized accordingly. Section 17.2 presents the common architecture. Section 17.3, Section 17.4, and Section 17.5 then describe the three first stages in turn, each followed by a worked example. Section 17.6 briefly covers two older non-iterative CFA estimators that lavaan keeps for reference, Section 17.7 compares the estimators, and the implementation notes at the end map the machinery to the source files.

17.1 Why multi-stage estimation?

When all stages are non-iterative, the estimator has several attractive properties. It always returns a solution, since there is no convergence to fail. It needs no starting values and no parameter bounds. It is fast, also for models with many indicators, because each stage reduces to linear algebra on the sample moments. And because the directed effects are estimated equation by equation, a misspecification in one equation does not automatically contaminate the estimates in the other equations, a property that Bollen (1996) calls the locality of the estimator, in contrast to the global propagation of misspecification under a single fitting criterion (see also the motivation of the SAM approach in Section 18.1).

The price is some loss of efficiency under a correctly specified model with normal data, and a set of restrictions that follow from the stage-wise architecture: constraints that tie a directed effect to a variance cannot be honored, some model features (higher-order factors, nonrecursive structural parts, categorical data) are supported by some first stages but not by others, and the solution may be inadmissible (a negative variance, say), since no bounds are enforced. Historically, inference was also less developed than for the discrepancy-based estimators. That is no longer the case: all three estimators provide analytic delta-method standard errors and a residual-based test statistic by default.

17.2 The common architecture

17.2.1 Estimators as functions of the sample moments

The unifying principle is that each of the three estimators is an exact function of the sample moments. Writing \mathbf{s}_g for the stacked sample mean vector and half-vectorized sample covariance matrix of group g,

\mathbf{s}_g = \bigl( \bar{\mathbf{y}}_g^{\prime}, \text{vech}(\mathbf{S}_g)^{\prime} \bigr)^{\prime},

the complete estimator, from the first stage through the mean-structure solve, is a deterministic map

\hat{\boldsymbol{\vartheta}} = h(\mathbf{s}_1, \ldots, \mathbf{s}_G), \tag{17.1}

that never touches the individual observations. This has four practical consequences, which recur throughout the chapter.

  • The model can be fitted from a covariance matrix and a sample size alone (sample_cov, sample_nobs), exactly as from the raw data, and the results are identical.

  • Incomplete data are handled by the two-stage approach of Section 8.4.11: the EM estimates of the saturated moments replace the sample moments, and nothing else changes in the estimator. This is selected automatically when the data contain missing values (missing = "two.stage", or "robust.two.stage" for sandwich-corrected standard errors; a request for missing = "ml" is mapped to the two-stage approach).

  • Categorical data are handled by running the same algebra on the polychoric correlation matrix and thresholds (in lavaan 0.7-4, only for the IV estimator; see Section 17.3.6).

  • Standard errors follow from the delta method: the Jacobian of the map Equation 17.1 over the moments, combined with the asymptotic covariance matrix of the moments (Section 17.2.6).

The IV estimator also has a second, raw-data engine (iv_samplestats = FALSE), in which the per-equation regressions are performed casewise; it gives the same point estimates for complete continuous data, but none of the moment-based features. The moments engine is the current default.

Sampling weights (sampling_weights) fit into the same scheme: the weighted sample moments take the place of the sample moments, and the estimator itself does not change. What does change is the inference. The normal-theory covariance matrix of the moments ignores the sampling design, so the standard errors and the test statistic switch to the distribution-free flavor, computed with the weights (Section 17.2.6 and Section 17.2.7). In lavaan 0.7-4, sampling weights are supported by the IV estimator (moments engine) and by the multiple-group method, also in combination with incomplete data: the weights then enter the EM estimates of the moments, and the sandwich version of their covariance matrix (missing = "robust.two.stage") is used automatically. The James-Stein estimators and the raw-data engine of the IV estimator stop with an error.

17.2.2 The equation decomposition

The IV and James-Stein estimators do not fit the model as a whole: they estimate the directed parameters equation by equation. Consider the LISREL all-y model of chapter 4,

\boldsymbol{\eta}= \boldsymbol{\alpha}+ \mathbf{B}\boldsymbol{\eta}+ \boldsymbol{\zeta}, \qquad \mathbf{y}= \boldsymbol{\nu}+ \boldsymbol{\Lambda}\boldsymbol{\eta}+ \boldsymbol{\epsilon},

in which every latent variable \eta_m has a marker (scaling) indicator y_{1m} whose loading is fixed to one and, when a mean structure is present, whose intercept is fixed to zero, so that y_{1m} = \eta_m + \epsilon_{1m}. Read row by row, the model contains one linear equation for every dependent variable: for a non-marker indicator y_p of factor \eta_m, and for a latent dependent variable \eta_e,

\begin{aligned} y_p &= \nu_p + \lambda_{pm}\, \eta_m + \epsilon_p, \\ \eta_e &= \alpha_e + \mathbf{a}_e^{\prime} \boldsymbol{\eta}_{A_e} + \boldsymbol{\gamma}_e^{\prime} \mathbf{x}_e + \zeta_e, \end{aligned} \tag{17.2}

where \boldsymbol{\eta}_{A_e} collects the latent regressors of \eta_e (with coefficients \mathbf{a}_e, the free elements of row e of \mathbf{B}) and \mathbf{x}_e its observed covariates, if any. The coefficients of these equations are exactly the directed parameters of the model: the loadings and the regression coefficients. If the latent variables were observed, each equation could be estimated by ordinary least squares.

Because they are not observed, the latent variables are replaced by observed proxies. On the left-hand side this is harmless: a latent dependent variable is replaced by its marker y_{1e}, and the measurement error \epsilon_{1e} of the marker becomes part of the disturbance of the equation. On the right-hand side it is not: a proxy measures the latent regressor with error, and a regression on an error-ridden regressor gives inconsistent coefficients. The estimators differ in how they construct the proxies and in how they neutralize this error. The IV estimator (Section 17.3) takes the marker of each latent regressor as its proxy, and removes the measurement error by projecting the marker on instrumental variables. The scaling James-Stein estimator (Section 17.4) also starts from the marker, but shrinks it with an estimate of its reliability, which turns the proxy into the conditional expectation of the latent variable given the marker. The aggregated James-Stein estimator does the same with a weighted sum of all the indicators of the latent regressor, a more reliable proxy than a single marker. The multiple-group method (Section 17.5) does not use the equation decomposition at all; it works on sum scores of the indicators and is restricted to CFA models.

In all cases, the equations are constructed from the parameter table, one per dependent variable, and each is solved in closed form from the sample moments.

17.2.3 The second stage: variances and covariances

After the first stage, the directed parameters \boldsymbol{\vartheta}_1 (loadings, regression coefficients, and the per-equation intercepts) are fixed at their estimates. The undirected parameters \boldsymbol{\vartheta}_2, the free elements of \boldsymbol{\Theta} and \boldsymbol{\Psi}, are then estimated by one weighted least squares step on the moment structure. Because the model-implied covariance matrix is linear in \boldsymbol{\vartheta}_2 once \boldsymbol{\vartheta}_1 is fixed, a single linearization is exact:

\hat{\boldsymbol{\vartheta}}_2 = \bigl( \boldsymbol{\Delta}_2^{\prime} \mathbf{W} \boldsymbol{\Delta}_2 \bigr)^{-1} \boldsymbol{\Delta}_2^{\prime} \mathbf{W}\, \bigl[ \mathbf{s} - \boldsymbol{\sigma}(\hat{\boldsymbol{\vartheta}}_1, \mathbf{0}) \bigr], \tag{17.3}

where \boldsymbol{\Delta}_2 holds the columns of the model Jacobian (chapter 4) that belong to \boldsymbol{\vartheta}_2, evaluated at \hat{\boldsymbol{\vartheta}}_1, and the subtracted term is the model-implied moment vector with all free undirected parameters set to zero. This offset matters whenever some variance or covariance is fixed at a nonzero value (a factor variance fixed to one under std_lv = TRUE, or a fixed residual covariance): the moment structure is then affine rather than linear in \boldsymbol{\vartheta}_2, and solving through the origin would bias the solution. For models in which all undirected parameters are free or fixed to zero, the offset vanishes.

The weight matrix has the normal-theory form

\mathbf{W} = \text{bdiag}\Bigl( \mathbf{S}^{*-1},\; \tfrac{1}{2} \mathbf{D}^{\prime} (\mathbf{S}^{*-1} \otimes \mathbf{S}^{*-1}) \mathbf{D}\Bigr),

built from a matrix \mathbf{S}^{*} that determines the flavor of the second stage. Four choices are available, through the iv_varcov_method, js_varcov_method, and mgm_varcov options respectively:

Table 17.1: The four second-stage methods shared by the IV, James-Stein, and multiple-group estimators.
Value \mathbf{S}^{*} Remarks
"ULS" \mathbf{I} unweighted; the default for categorical data
"GLS" \mathbf{S} the sample covariance matrix
"2RLS" \hat{\boldsymbol{\Sigma}} from a first ULS step model-implied, two rounds
"RLS" \hat{\boldsymbol{\Sigma}}, iterated to a fixed point reweighted least squares; the current default for continuous data

The reweighted least squares (RLS) variant re-evaluates the weight matrix at the model-implied covariance matrix of the previous round until the estimates stabilize, which typically takes 5 to 15 rounds of one linearization each. It is the only iterative element of the whole procedure. The matrix \mathbf{W} is never formed explicitly: the products \mathbf{W} \boldsymbol{\Delta}_2 are streamed column by column. For the multiple-group method, the classic closed-form solution for \boldsymbol{\Psi} and \boldsymbol{\Theta} (Section 17.5.1) takes the place of the second stage, unless the model contains residual covariances, which switch the second stage on automatically (mgm_varcov = "default").

17.2.4 The mean structure

When a mean structure is present, the first stage provides a per-equation intercept, \hat{\beta}_0 = \bar{y} - \bar{\mathbf{x}}^{\prime} \hat{\boldsymbol{\beta}}. Under the current default (iv_mean_structure = "wls", and likewise for the other two estimators), all free mean parameters are then re-solved jointly by generalized least squares on the mean structure, with weights N_g \hat{\boldsymbol{\Sigma}}_g^{-1}: observed intercepts and latent means, including the means of exogenous latent variables that have no equation of their own. The mean structure is linear in these parameters, so the solve is exact, it pools intercepts that are constrained equal across groups (scalar invariance), and it reproduces the ML estimates of the mean parameters given the covariance parameters. The marker intercepts are fixed to zero, so that the mean of a latent variable equals the population mean of its marker.

17.2.5 Equality constraints and multiple groups

The constraint machinery of Section 7.7 was designed for a single global criterion and does not carry over as such. What the multi-stage estimators support instead follows from the linear algebra of each stage.

Every first-stage equation contributes a normal-equation block (\mathbf{A}_e, \mathbf{b}_e) for its slopes, tagged with the global indices of the free parameters involved. A simple equality constraint (two parameters carrying the same label, within a group or across groups through group_equal) means that two equations share a free index. The blocks are then accumulated into one system and solved jointly:

\hat{\boldsymbol{\theta}} = \Bigl( \sum_e \mathbf{C}_e^{\prime} \mathbf{A}_e \mathbf{C}_e \Bigr)^{-1} \sum_e \mathbf{C}_e^{\prime} \mathbf{b}_e, \tag{17.4}

where \mathbf{C}_e maps the free parameters to the coefficients of equation e (a selection matrix, or a duplication map when a label is repeated within one equation). Without shared indices, Equation 17.4 reproduces the per-equation solutions exactly, so that a configural multiple-group fit is identical to the separate single-group fits, in the estimates and in the standard errors. General linear constraints (a == 2*b) enter the same system as linear restrictions, through a small quadratic program. In the second stage, linear equality constraints among the variances and covariances are imposed by projection, with the weighted least squares Hessian as the metric. Constraints that span the two stages (a loading tied to a variance) cannot be honored by a sequential procedure: lavaan warns and ignores them. Nonlinear constraints, inequality constraints, and parameter bounds are not supported.

Multiple groups run stage by stage per group, each with its own moments; the pooled solve Equation 17.4 and the joint mean solve are the only couplings between groups. The standard measurement-invariance sequence (configural, metric, scalar) is therefore available for all three estimators, through group_equal or shared labels.

17.2.6 Standard errors

Because the estimator is the map Equation 17.1, its asymptotic covariance matrix is a delta-method expression over the moments:

\widehat{\text{Var}}(\hat{\boldsymbol{\vartheta}}) = \sum_{g=1}^{G} \frac{1}{N_g}\, \mathbf{J}_g\, \boldsymbol{\Gamma}_g\, \mathbf{J}_g^{\prime}, \qquad \mathbf{J}_g = \frac{\partial h}{\partial \mathbf{s}_g^{\prime}}, \tag{17.5}

with \boldsymbol{\Gamma}_g the asymptotic covariance matrix of the moments of group g (Section 5.6.2). This single formula covers every analytic standard error in the family, which is why the summary() header reports Standard errors: Delta for all three estimators, followed by the flavor of \boldsymbol{\Gamma} that was used:

  • NT, the normal-theory \boldsymbol{\Gamma} (Equation 8.18), evaluated at the model-implied covariance matrix under the current default (iv_vcov_gamma_modelbased, js_vcov_gamma_modelbased), or at the sample covariance matrix when the former is not positive definite;

  • ADF, the distribution-free estimate (Equation 8.16), requested with se = "robust" (a shortcut for iv_gamma = "adf", js_gamma = "adf" and mgm_gamma = "adf"); it requires complete raw data, and since the casewise influence of a moment-based estimator is \mathbf{J} times the casewise moment contribution, this flavor equals the infinitesimal-jackknife (sandwich) covariance of the estimator. With sampling weights, it is the default, and \boldsymbol{\Gamma} is computed with the weights; asking for the normal-theory flavor then gives a warning. For the IV estimator, it cannot be combined with external instruments in lavaan 0.7-4;

  • TS, the two-stage moment covariance under incomplete data: the inverse of the saturated information matrix (Savalei & Bentler, 2009), or its sandwich under missing = "robust.two.stage" (Savalei & Falk, 2014); see the sandwich formula in appendix D.9.6. With sampling weights, the sandwich is always used, and it is computed with the weights.

Two details of the implementation are worth knowing. First, the p^{\star} \times p^{\star} normal-theory \boldsymbol{\Gamma} is never materialized: for two rows \mathbf{x} and \mathbf{y} of the Jacobian (their vech parts), the sandwich entry is obtained from the identity \mathbf{x}^{\prime} \boldsymbol{\Gamma}^{\mathrm{NT}} \mathbf{y} = 2\,\text{tr}(\mathbf{X} \boldsymbol{\Sigma}\mathbf{Y} \boldsymbol{\Sigma}), with \mathbf{X} = \text{unvech}(\mathbf{x}) (off-diagonal elements halved), so that the cost is one pair of P\times P products per parameter. Second, the three estimators obtain \mathbf{J} differently. The IV estimator assembles it block-wise, and fills in the covariances between the blocks afterwards (Section 17.3.7). The James-Stein estimators differentiate the complete map in one analytic chain-rule sweep (Section 17.4.6), which gives the full covariance matrix at once. In both cases the covariances between the directed and the undirected parameters are available, so that the standardized solution, defined parameters (:=) and Wald tests receive proper delta-method standard errors. The multiple-group method uses an analytic Jacobian for its main branches and falls back to numerical differentiation of the map for the remaining ones (Section 17.5.6). The numerical fallback is always available, but it is slow: for a model with 30 indicators it costs about 20 seconds where the analytic sweep costs a tenth of a second.

In all cases, se = "bootstrap" is available as well (each replication reruns the complete estimator), as is se = "none".

17.2.7 Test statistics and fit measures

There is no discrepancy function, hence no standard chi-square statistic: the "standard" entry of the test list is an NA placeholder. The default test is Browne’s residual-based statistic (Section 8.5.10), test = "browne.residual.nt", computed by the generic machinery from the residual moment vector \mathbf{s} - \boldsymbol{\sigma}(\hat{\boldsymbol{\vartheta}}) and \boldsymbol{\Gamma}; the ADF version ("browne.residual.adf") can be requested. Under incomplete data, the same two statistics are used, with the two-stage covariance matrix of the EM moments as \boldsymbol{\Gamma}: the normal-theory version with missing = "two.stage", and the ADF version (based on the sandwich) with missing = "robust.two.stage". The ADF version is also the default when the ADF flavor of \boldsymbol{\Gamma} is used for the standard errors, and therefore with sampling weights. It should be read with caution: the ADF statistic is known to reject correctly specified models too often unless the sample is large, and this also holds with sampling weights. The fit measures are derived from this statistic. The baseline model is fitted with the same estimator (without latent variables there is no first stage, so it reduces to the second stage and the mean solve), so that CFI, TLI, and their relatives are available. Likelihood-based quantities (the loglikelihood, AIC, BIC) are NA, and modification indices are not available, since there is no objective gradient. For the IV estimator, the per-equation overidentification tests of Section 17.3.5 partly fill that role.

17.3 The instrumental-variable estimator

The use of instrumental variables in factor analysis has a long history (see also Section 17.6), but it was Bollen (1996) who developed instrumental variables into a full alternative to the discrepancy-based estimators for general structural equation models. His model-implied instrumental variables (MIIV) are derived from the model itself, rather than collected from external sources, and the resulting MIIV-2SLS estimator is implemented in the MIIVsem package (Fisher & Bollen, 2020). The implementation in lavaan, requested with estimator = "IV" (alias "MIIV"), reproduces the MIIVsem point estimates and standard errors and adds a number of extensions: a moments engine, the k-class alternatives to 2SLS, external instruments, robust overidentification tests, the second-stage methods of Table 17.1, two-stage missing data, multiple groups with measurement-invariance constraints, and analytic standard errors for all of these.

17.3.1 Model-implied instruments

The IV estimator uses the marker of each latent variable as its proxy. In the equations Equation 17.2, this amounts to a reparameterization of the model (Bollen, 1996). Collect the M markers in \mathbf{y}_1 and the remaining P- M indicators in \mathbf{y}_2. The marker equations read \mathbf{y}_1 = \boldsymbol{\eta}+ \boldsymbol{\epsilon}_1, so that the latent variables can be eliminated: \boldsymbol{\eta}= \mathbf{y}_1 - \boldsymbol{\epsilon}_1. Substituting this into the structural and the remaining measurement equations gives

\begin{aligned} \mathbf{y}_1 &= \boldsymbol{\alpha}+ \mathbf{B}\mathbf{y}_1 + \bigl[ (\mathbf{I} - \mathbf{B}) \boldsymbol{\epsilon}_1 + \boldsymbol{\zeta}\bigr], \\ \mathbf{y}_2 &= \boldsymbol{\nu}_2 + \boldsymbol{\Lambda}_2 \mathbf{y}_1 + \bigl[ \boldsymbol{\epsilon}_2 - \boldsymbol{\Lambda}_2 \boldsymbol{\epsilon}_1 \bigr], \end{aligned} \tag{17.6}

a system of P regression equations among observed variables only, one for every dependent variable of the model: for a non-marker indicator y_p of factor \eta_m, the equation y_p = \nu_p + \lambda_{pm}\, y_{1m} + u_p; for a latent dependent variable \eta_e with marker y_{1e}, the equation y_{1e} = \alpha_e + \mathbf{a}_e^{\prime} \mathbf{y}_{1,A_e} + \boldsymbol{\gamma}_e^{\prime} \mathbf{x}_e + u_e, in which \mathbf{y}_{1,A_e} are the markers of the latent regressors. The coefficients are still the directed parameters of the model. The difficulty lies in the composite error terms u, the bracketed terms in Equation 17.6: they contain the measurement errors of the markers that also appear as regressors. The regressors are therefore correlated with the error term of their own equation, and ordinary least squares is inconsistent. The remedy is to project the regressors on instruments: variables that are correlated with the regressors, but not with u. After a fit with the IV estimator, the system of equations and the instruments of each equation are returned by lavInspect(fit, "iv") (see Section 17.3.8).

Write one equation of the system Equation 17.6 generically as y_p = \beta_{0p} + \mathbf{x}_p^{\prime} \boldsymbol{\beta}_p + u_p, with \beta_{0p} the intercept. Instruments \mathbf{z}_p for the endogenous regressors in \mathbf{x}_p must satisfy two conditions: they must be correlated with the regressors, and they must be uncorrelated with the composite error u_p. When all instruments are observed variables of the model, both conditions can be checked from the model structure alone. The first follows from the model-implied covariance matrix, evaluated at arbitrary nonzero values of the free parameters. The second follows from the covariance matrix between the composite errors and the observed variables. With \boldsymbol{\Pi} the P\times M matrix of coefficients in Equation 17.6 (the rows of \mathbf{B} for the marker equations, the rows of \boldsymbol{\Lambda} for the others), the composite errors are \mathbf{u} = \mathbf{y}- \boldsymbol{\beta}_0 - \boldsymbol{\Pi} \mathbf{y}_1, so that

\text{Cov}(\mathbf{u}, \mathbf{y}) = \boldsymbol{\Sigma}- \mathbf{Q} \boldsymbol{\Sigma}, \tag{17.7}

where \mathbf{Q} is an P\times P matrix of zeros whose marker columns hold \boldsymbol{\Pi}. An observed variable qualifies as an instrument for equation p when its entry in row p of Equation 17.7 is structurally zero. Working out the blocks shows that residual covariances in \boldsymbol{\Theta} are what disqualify instruments: an indicator whose measurement error is correlated with the error of the dependent variable cannot serve. For higher-order factors, some markers are themselves latent; the search then runs on the joint covariance matrix of the observed and latent variables, and the rows of the higher-order factors are folded into those of their observed markers.

The model-implied instrument set of each equation is the set of all observed variables with a structurally zero covariance with u_p and a nonzero covariance with the regressors. This is the set that is used, unless the user intervenes with the |~ operator (Section 17.3.4). An equation whose regressors are all exogenous observed variables, or that contains only an intercept, needs no instruments and is estimated by ordinary least squares.

17.3.2 Two-stage least squares in moment form

Per equation, let \mathbf{S}_{zz}, \mathbf{S}_{zx}, \mathbf{S}_{xx} denote the relevant blocks of the sample covariance matrix and \mathbf{s}_{zy}, \mathbf{s}_{xy} the covariance vectors with the dependent variable. The first stage of 2SLS regresses the regressors on the instruments, the second stage regresses y on the fitted values. Both stages together are covariance algebra:

\mathbf{A} = \mathbf{S}_{xz} \mathbf{S}_{zz}^{-1} \mathbf{S}_{zx}, \qquad \mathbf{b} = \mathbf{S}_{xz} \mathbf{S}_{zz}^{-1} \mathbf{s}_{zy}, \qquad \hat{\boldsymbol{\beta}} = \mathbf{A}^{-1} \mathbf{b}, \qquad \hat{\beta}_0 = \bar{y} - \bar{\mathbf{x}}^{\prime} \hat{\boldsymbol{\beta}}. \tag{17.8}

Three special cases make the formula transparent. If \mathbf{z} = \mathbf{x} (an OLS equation), then \mathbf{A} = \mathbf{S}_{xx} and \mathbf{b} = \mathbf{s}_{xy}. If the equation is exactly identified (\mathbf{S}_{zx} square), the projection drops out and \hat{\boldsymbol{\beta}} = \mathbf{S}_{zx}^{-1} \mathbf{s}_{zy}, the indirect least squares estimator. If the equation is overidentified, the projection through \mathbf{S}_{zz}^{-1} weights the moment conditions \text{Cov}(\mathbf{z}, y - \mathbf{x}^{\prime} \boldsymbol{\beta}) = \mathbf{0} optimally under homoskedasticity. Fixed coefficients (a loading fixed to one, a user-fixed regression) are moved to the right-hand side before solving. The residual variance follows in moment form as well, \hat{\sigma}^2 = s_{yy} - 2 \hat{\boldsymbol{\beta}}^{\prime} \mathbf{s}_{xy} + \hat{\boldsymbol{\beta}}^{\prime} \mathbf{S}_{xx} \hat{\boldsymbol{\beta}}, and the per-equation covariance matrix of the coefficients is the familiar \hat{\sigma}^2 \mathbf{A}^{-1} / N of a regression on the second-stage design.

Two conventions deserve mention. By default, the IV estimator uses the unbiased divisors: N- 1 for the sample covariance matrix and N- K for the residual variance of an equation with K coefficients (the intercept included). With iv_mimic_ml = TRUE, the ML divisor N is used throughout, and for an exactly identified model the IV estimates and standard errors then coincide with the ML solution, a useful correctness check. And each equation stores its slope block (\mathbf{A}, \mathbf{b}), which is the building block of the pooled constrained solve Equation 17.4 and of the analytic standard errors.

17.3.3 LIML and Fuller: the k-class family

A specified model easily implies many candidate instruments per equation, and 2SLS with many instruments of limited collective strength is biased towards OLS in finite samples. The traditional answer is to select a subset of the instruments; the alternative is to keep all of them and to switch to an estimator that does not suffer from the many-instrument bias. Define the conditional moments given the instruments,

\mathbf{C}_{xx \cdot z} = \mathbf{S}_{xx} - \mathbf{S}_{xz} \mathbf{S}_{zz}^{-1} \mathbf{S}_{zx}, \qquad \mathbf{c}_{xy \cdot z} = \mathbf{s}_{xy} - \mathbf{S}_{xz} \mathbf{S}_{zz}^{-1} \mathbf{s}_{zy}.

The k-class estimator is

\mathbf{A}_k = \mathbf{S}_{xx} - k\, \mathbf{C}_{xx \cdot z}, \qquad \mathbf{b}_k = \mathbf{s}_{xy} - k\, \mathbf{c}_{xy \cdot z}, \qquad \hat{\boldsymbol{\beta}}_k = \mathbf{A}_k^{-1} \mathbf{b}_k. \tag{17.9}

With k = 0 this is OLS, with k = 1 it is exactly 2SLS, and with k = \hat{\lambda} it is the limited-information maximum likelihood (LIML) estimator of Anderson and Rubin (1949), where \hat{\lambda} is the smallest generalized eigenvalue of \mathbf{S}_{vv} relative to its conditional counterpart \mathbf{S}_{vv \cdot z}, for \mathbf{v} = (y, \mathbf{x}^{\prime})^{\prime}. LIML minimizes the ratio of the residual variance of the equation to its residual variance given the instruments (the least-variance-ratio derivation), and \hat{\lambda} \geq 1 always, with \hat{\lambda} - 1 measuring how badly the overidentifying restrictions fit. For an exactly identified equation, \hat{\lambda} = 1 identically, so that LIML and 2SLS coincide. The Fuller modification (Fuller, 1977) uses k = \hat{\lambda} - c/(N- P_z - 1), with P_z the number of instruments and c a positive constant (iv_fuller_c, default 1); unlike LIML, it has finite moments. Because Equation 17.9 only redefines (\mathbf{A}, \mathbf{b}), everything downstream (the slope blocks for pooling, the residual variance, the standard errors) uses the k-class solution without further changes. The method is selected with the iv_method option ("2SLS", the default, "LIML", or "Fuller"), and the summary() header shows the non-default choice. In simulations with one endogenous regressor and instruments of fixed collective strength, the median bias of 2SLS grows steadily with the number of instruments while LIML stays essentially unbiased, at the price of a somewhat larger dispersion (Maydeu-Olivares et al., 2026).

17.3.4 Choosing instruments by hand

The |~ operator overrides the automatic choice for one equation. Its left-hand side is the dependent variable of the equation (for a latent dependent variable, its marker); its right-hand side lists the instruments:

ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem60 ~ ind60
# use only x2 and x3 as instruments for the dem60 ~ ind60 equation
y1 |~ x2 + x3

Two situations are covered. If the named variables are part of the model, the operator selects a subset of the model-implied instruments (fewer, stronger instruments). If a named variable does not appear anywhere in the model, it is an external instrument: it is read from the data, its covariances with the model variables are made available to the 2SLS solve through an augmented moment matrix over the model variables and the instruments, but it never enters the model-implied moments. The degrees of freedom, the fit measures, and \hat{\boldsymbol{\Sigma}} are exactly as if it had not been mentioned. External instruments require raw data, and for categorical data they must be ordered variables themselves. Their sampling variability is folded into the standard errors of the second-stage parameters through the augmented moment Jacobian, rather than being treated as fixed.

Weak instruments are the classic small-sample pathology of 2SLS. lavaan computes the first-stage F statistic per equation and regressor (Staiger & Stock, 1997) and, when it falls below iv_weak_threshold (default 10), warns (iv_weak = "warn", the default), drops the weakest excess instruments of overidentified equations ("prune"), or stays silent ("none").

17.3.5 Overidentification tests

An equation with more instruments than regressors carries testable moment conditions: the vector \mathbf{g} = \mathbf{s}_{zy} - \mathbf{S}_{zx} \hat{\boldsymbol{\beta}} should be zero up to sampling error, with df = P_z - P_x degrees of freedom (P_x is the number of regressors of the equation). lavaan reports one statistic per overidentified equation, in lavInspect(fit, "sargan"); which one depends on the data and on the test option. For continuous data, the default is the classical Sargan statistic (Sargan, 1958),

T_S = N\, \frac{\mathbf{g}^{\prime} \mathbf{S}_{zz}^{-1} \mathbf{g}} {\hat{\sigma}^2} \sim \chi^2_{df},

which is the NR^2 of the regression of the residuals on the instruments. It is valid for continuous data under homoskedasticity, and not on polychoric correlations. The robust version applies the residual-based logic of Browne (1984) to the single equation: since \mathbf{g} is linear in the sample moments, its asymptotic covariance matrix \boldsymbol{\Gamma}_{\mathbf{g}} follows from the covariance matrix of the moments (the ADF estimate for continuous data, the polychoric asymptotic covariance for categorical data), and

T_B = N\, \mathbf{g}^{\prime} \bigl[ \mathbf{W} - \mathbf{W} \mathbf{D} (\mathbf{D}^{\prime} \mathbf{W} \mathbf{D})^{-1} \mathbf{D}^{\prime} \mathbf{W} \bigr] \mathbf{g}, \qquad \mathbf{W} = \boldsymbol{\Gamma}_{\mathbf{g}}^{-1}, \quad \mathbf{D} = \mathbf{S}_{zx},

is the equation-level analog of Hansen’s J test (lavInspect(fit, "hansen") is an alias). This statistic is reported instead of the Sargan statistic for categorical data, and for continuous data when the test is "browne.residual.adf" (on request, or by default with se = "robust" or sampling weights); the columns are then labeled browne.stat and browne.pval. Under LIML or Fuller, the first-order conditions of 2SLS no longer hold, and the Sargan form is replaced by the likelihood ratio statistic of Anderson and Rubin (1949), N \log \hat{\lambda}, where \hat{\lambda} is the minimized LIML variance ratio of Section 17.3.3 (Fuller uses the same \hat{\lambda}). This is the maximum likelihood chi-square statistic of the single-equation instrumental-variables regression model (the equation y ~ x, the reduced form x ~ z, and a free covariance y ~~ x) fitted with the normal likelihood; the columns are then labeled lr.stat and lr.pval. A multiplicity adjustment over the overidentified equations is available through iv_sargan_adjust (any method of p.adjust()).

These are local misfit tests: an equation rejects when its instruments correlate with its error, which localizes a misspecification far better than a global chi-square statistic. The converse does not hold: a correctly specified equation embedded in a wrong model can still pass.

17.3.6 Categorical data

For ordered categorical data, the moments are the polychoric correlation matrix and the thresholds of chapter 14, and the 2SLS kernel Equation 17.8 is applied to the correlations: this is the polychoric instrumental variable (PIV) estimator of Bollen and Maydeu-Olivares (2007). The thresholds equal their sample values (they are saturated), the second stage defaults to ULS (the RLS reweighting assumes a covariance metric), and the standard errors use the polychoric asymptotic covariance matrix of the sample statistics. Multiple groups are supported, with cross-group constraints through the pooled solve as for continuous data. The two-stage treatment of missing values is not available for categorical data.

The indicators can also be a mix of ordinal and continuous variables (Section 14.4.4). The moment vector then contains, per group, the thresholds and the means of the continuous variables, the variances of the continuous variables, and the off-diagonal elements of a matrix that holds polychoric correlations, polyserial covariances and ordinary covariances: the continuous variables keep their own metric. The 2SLS kernel runs on this matrix unchanged; the only difference with the all-ordinal case is that a variance of a continuous variable is a sample moment with sampling variability, whereas the unit variance of a latent response is not, so that the Jacobian of Equation 17.5 has a column for the former and none for the latter. The second stage fits the residual variances of the continuous indicators from these variance moments, and the standard errors use the asymptotic covariance matrix of the complete moment vector. As for continuous data, the intercept of a continuous marker is fixed to zero and the mean of its factor is free; the mean of a factor with an ordinal marker is fixed to zero. Given the directed parameters, the threshold and mean part of the model is linear in the thresholds, the intercepts and the latent means, and saturated, so these parameters follow from one linear solve. Note that the thresholds of the ordinal indicators of a factor with a nonzero mean no longer equal their sample values: they absorb the mean of the latent response.

In a multiple group analysis, the thresholds can be constrained to be equal across groups (group_equal = c("loadings", "thresholds"), see chapter 14). In the Delta parameterization, the scaling factors (~*~) and the intercepts of the latent responses are then free in the second and later groups, and the sample statistics of such a group are no longer in the metric of the model: if \delta_p is the scaling factor of y_p^{\star}, \mu_p^{\star} its mean, and \boldsymbol{\tau}_p its (common) thresholds, the sample thresholds estimate \delta_p (\boldsymbol{\tau}_p - \mu_p^{\star}) and the polychoric correlations estimate \delta_p \delta_{p'} \sigma_{pp'}^{\star}. The IV estimator therefore adds a preliminary stage. A free scaling factor is estimated from the thresholds only, as the slope of the least-squares regression of the sample thresholds of the variable in that group on its sample thresholds in the reference group (where the scaling factor is fixed to one); this needs at least two thresholds, or three response categories, that are equal across the groups. The sample correlations are then divided by \delta_p \delta_{p'}, which brings them to the metric of the latent responses of the model, where the equations Equation 17.2 hold and where equal loadings can be pooled across groups; the 2SLS kernel runs on this rescaled matrix. The second stage and the joint solve for the thresholds, intercepts and latent means use the original statistics, with the scaling factors substituted. For the standard errors, the scaling factors are treated as additional first-stage parameters, so that their sampling variability is carried over to all the other parameters. In lavaan 0.7-4, free scaling factors cannot be combined with equality constraints among the scaling factors themselves, or with external instruments (Section 17.3.4).

The same rescaling idea handles the Theta parameterization (parameterization = "Theta"). There, the residual variance of a latent response is fixed to one, and its total variance, 1/\delta_p^2, is a function of the model parameters: \delta_p^2 is the unique variance of y_p^{\star} in the correlation metric. These unique variances are obtained from a preliminary fit in the correlation metric that ignores all equality constraints (per-equation 2SLS, followed by ULS for the variances and covariances), which is valid whatever the constraints of the model. (If a residual variance is free, as in the second and later groups when the thresholds are equal across groups, the scaling factor is again based on the thresholds.) The sample statistics are then rescaled to the Theta metric, and the two stages and the joint solve for the thresholds proceed as before; equality constraints (equal loadings, for example) are now imposed in the Theta metric, where they belong. Without equality constraints, the Theta and Delta solutions are the same model in two metrics: the standardized solution and the test statistic are identical. For the Theta parameterization, the standard errors are based on a numerical Jacobian of the complete map Equation 17.1, and external instruments are not supported in lavaan 0.7-4.

17.3.7 Standard errors for the IV estimator

The IV estimator assembles the Jacobian of Equation 17.5 block-wise. For the directed parameters, the per-equation Jacobian over the moments follows from implicit differentiation of the normal equations \mathbf{A} \hat{\boldsymbol{\beta}} = \mathbf{b} (Fisher & Bollen, 2020):

d\hat{\boldsymbol{\beta}} = \mathbf{A}^{-1} \bigl( d\mathbf{b} - d\mathbf{A}\, \hat{\boldsymbol{\beta}} \bigr) = \mathbf{A}^{-1} \mathbf{M}(\hat{\boldsymbol{\beta}}), \qquad \mathbf{M}(\boldsymbol{\beta}) = \frac{\partial\, (\mathbf{b} - \mathbf{A} \boldsymbol{\beta})}{\partial\, \text{vech}(\mathbf{S})^{\prime}}, \tag{17.10}

where \mathbf{M} is assembled from selection logic (each sample covariance enters the residual moment through at most two entries). The enabling observation for constraints and multiple groups is that \mathbf{M}(\boldsymbol{\beta}) is linear in \boldsymbol{\beta}, so that the pooled solve Equation 17.4 differentiates as

d\hat{\boldsymbol{\theta}} = \Bigl( \sum_e \mathbf{C}_e^{\prime} \mathbf{A}_e \mathbf{C}_e \Bigr)^{-1} \sum_e \mathbf{C}_e^{\prime}\, \mathbf{M}_e(\boldsymbol{\beta}_{\text{pooled}}),

the same per-equation formula re-evaluated at the pooled coefficients, without second derivatives. For the k-class estimators, one rank-one term is added for the dependence of k on the moments (a generalized-eigenvalue perturbation; zero for 2SLS). For categorical data (in the Delta parameterization), the same chain is computed over the complete correlation matrix of each group and then mapped to the layout of the categorical moment vector: the thresholds, the variances of the continuous variables, and the off-diagonal elements; the unit variances of the latent responses are not sample statistics and have no column. With free scaling factors, the chain is evaluated at the rescaled statistics and includes the derivatives of the rescaling with respect to the scaling factors. The first-stage Jacobian is therefore analytic for categorical data too, with or without equality constraints among the directed parameters.

Under the current default, the directed-effect standard errors are nevertheless taken from the per-equation regression covariances (iv_vcov_stage1 = "lm.vcov.dfres"), with a variance-weighted restricted-2SLS covariance under simple equality constraints, as in MIIVsem; the delta-method version ("gamma") is used automatically for general linear constraints, two-stage missing data, categorical data, and the ADF flavor of \boldsymbol{\Gamma} (iv_gamma = "adf", se = "robust", or sampling weights). For the undirected parameters (iv_vcov_stage2 = "h2", the default), the second-stage solution \hat{\boldsymbol{\vartheta}}_2 = \mathbf{H}(\hat{\boldsymbol{\vartheta}}_1)\, \mathbf{s} is differentiated as \mathbf{H}(\mathbf{I} - \boldsymbol{\Delta}_1 \mathbf{K}), with \mathbf{K} the directed-effect Jacobian: a perturbation of the moments moves the directed estimates, which shifts the explained part of the moment structure, and the second stage sees only the remainder. The curvature terms that this approximation omits vanish at \hat{\boldsymbol{\Sigma}}= \mathbf{S} and are asymptotically negligible. A fully numerical fallback (iv_vcov_stage2 = "delta") remains available and is used automatically when general linear constraints touch the undirected parameters.

Assembled in this way, the covariance matrix consists of separate blocks: the directed parameters (one block per equation for the regression-based flavors), the variances and covariances, and the thresholds. The covariances between these blocks, and between the equations, are not zero, and they are needed for the standard error of any function that combines parameters of different blocks or equations: the standardized solution, defined parameters (:=), and Wald tests. They are taken from the delta-method matrix Equation 17.5, computed from the Jacobians of all the blocks, and rescaled to the variances of the blocks as assembled; the variances themselves, and the covariances within a block, are left unchanged. If the combined matrix is not positive semidefinite, the complete rescaled delta-method matrix is used instead. The covariances between the blocks remain zero in three cases: external instruments with continuous data, iv_vcov_stage2 = "delta", and iv_vcov_stage1 = "none".

17.3.8 Example: the Political Democracy model

The classic industrialization and democracy model of Bollen (1989) serves as the running example for the IV and James-Stein estimators:

model_pd <- '
  # measurement model
    ind60 =~ x1 + x2 + x3
    dem60 =~ y1 + y2 + y3 + y4
    dem65 =~ y5 + y6 + y7 + y8
  # regressions
    dem60 ~ ind60
    dem65 ~ ind60 + dem60
'
fit_ml <- sem(model_pd, data = PoliticalDemocracy)
fit_iv <- sem(model_pd, data = PoliticalDemocracy, estimator = "IV")
fit_iv
lavaan 0.7-4 ended normally after 1 iteration

  Estimator                                         IV
  Optimization method                          Noniter
  Number of model parameters                        25

  Number of observations                            75

Model Test User Model:
                                                      
  Browne's residual-based (NT) test                   
  Test statistic                                55.032
  Degrees of freedom                                41
  P-value (Chi-square)                           0.070

The header shows that estimation took a single “iteration” and that the reported test is Browne’s residual-based statistic. The equation system and the model-implied instruments of each equation are returned by the "iv" keyword:

lavInspect(fit_iv, "iv")
     lhs           rhs lhs.new rhs.new type                        instruments
1     x2         ind60      x2      x1 miiv x3, y1, y2, y3, y4, y5, y6, y7, y8
2     x3         ind60      x3      x1 miiv x2, y1, y2, y3, y4, y5, y6, y7, y8
3     y2         dem60      y2      y1 miiv x1, x2, x3, y3, y4, y5, y6, y7, y8
4     y3         dem60      y3      y1 miiv x1, x2, x3, y2, y4, y5, y6, y7, y8
5     y4         dem60      y4      y1 miiv x1, x2, x3, y2, y3, y5, y6, y7, y8
6     y6         dem65      y6      y5 miiv x1, x2, x3, y1, y2, y3, y4, y7, y8
7     y7         dem65      y7      y5 miiv x1, x2, x3, y1, y2, y3, y4, y6, y8
8     y8         dem65      y8      y5 miiv x1, x2, x3, y1, y2, y3, y4, y6, y7
9  dem60         ind60      y1      x1 miiv                             x2, x3
10 dem65 ind60 + dem60      y5 x1 + y1 miiv                 x2, x3, y2, y3, y4

Each non-marker indicator is regressed on the marker of its factor, and each latent regression on the markers of its latent regressors (lhs.new and rhs.new). The instruments of the measurement equations are all indicators of the other factors plus the remaining indicators of the same factor; the instruments of the structural equations are fewer, because the residual variables of the regressions are correlated with more of the indicators. The per-equation overidentification tests are returned by the "sargan" keyword:

lavInspect(fit_iv, "sargan")
     lhs           rhs df sargan.stat sargan.pval
1     x2         ind60  8       8.080       0.426
2     x3         ind60  8       8.505       0.386
3     y2         dem60  8      18.360       0.019
4     y3         dem60  8       9.884       0.273
5     y4         dem60  8      14.487       0.070
6     y6         dem65  8      20.021       0.010
7     y7         dem65  8      13.400       0.099
8     y8         dem65  8      14.893       0.061
9  dem60         ind60  1       0.489       0.484
10 dem65 ind60 + dem60  3       0.769       0.857

Two measurement equations (those of y2 and y6) reject at the five percent level, which is where the misfit of this model is known to be located: the residual covariances among the democracy indicators that Bollen’s full model includes are absent here. The regression estimates of the two estimators can be compared side by side:

pe_ml <- parameterEstimates(fit_ml)
pe_iv <- parameterEstimates(fit_iv)
idx <- which(pe_ml$op == "~")
cbind(pe_ml[idx, c("lhs", "op", "rhs")],
      ML = round(pe_ml$est[idx], 3), ML.se = round(pe_ml$se[idx], 3),
      IV = round(pe_iv$est[idx], 3), IV.se = round(pe_iv$se[idx], 3))
     lhs op   rhs    ML ML.se    IV IV.se
12 dem60  ~ ind60 1.474 0.392 1.261 0.431
13 dem65  ~ ind60 0.453 0.220 1.123 0.319
14 dem65  ~ dem60 0.864 0.113 0.724 0.104

The two estimators agree on the effect of dem60 on dem65, but differ considerably on the direct effect of ind60 on dem65. Under a misspecified model this is to be expected: ML distributes the misfit over all parameters through its single fitting criterion, while the IV estimator confines it to the equations whose instruments are affected, and the two estimators need not move in the same direction. Which of the two is closer to the truth cannot be decided from a single sample; the equation-level tests above indicate which equations to examine.

The measurement equations of this model have nine instruments each, so the model is a natural candidate for LIML. The k-class method is passed through the estimator_args argument:

fit_liml <- sem(model_pd, data = PoliticalDemocracy, estimator = "IV",
                estimator_args = list(iv_method = "LIML"))
lavInspect(fit_liml, "sargan")
     lhs           rhs df lr.stat lr.pval
1     x2         ind60  8   8.699   0.368
2     x3         ind60  8   9.236   0.323
3     y2         dem60  8  20.919   0.007
4     y3         dem60  8  10.849   0.210
5     y4         dem60  8  15.995   0.042
6     y6         dem65  8  22.415   0.004
7     y7         dem65  8  14.709   0.065
8     y8         dem65  8  16.199   0.040
9  dem60         ind60  1   0.504   0.478
10 dem65 ind60 + dem60  3   0.805   0.848

The structural equations have only a few instruments, and their estimates hardly change. The LIML loadings are larger than the 2SLS loadings, most clearly for the democracy factors (1.30 against 1.09 for y6), and the overidentification statistic is now the Anderson–Rubin likelihood ratio statistic. Finally, the manual instrument selection of Section 17.3.4 is used in the same way:

model_pd_iv <- '
    ind60 =~ x1 + x2 + x3
    dem60 =~ y1 + y2 + y3 + y4
    dem60 ~ ind60
    y1 |~ x2 + x3
'
fit_iv2 <- sem(model_pd_iv, data = PoliticalDemocracy, estimator = "IV")
lavInspect(fit_iv2, "iv")
    lhs   rhs lhs.new rhs.new type        instruments
1    x2 ind60      x2      x1 miiv x3, y1, y2, y3, y4
2    x3 ind60      x3      x1 miiv x2, y1, y2, y3, y4
3    y2 dem60      y2      y1 miiv x1, x2, x3, y3, y4
4    y3 dem60      y3      y1 miiv x1, x2, x3, y2, y4
5    y4 dem60      y4      y1 miiv x1, x2, x3, y2, y3
6 dem60 ind60      y1      x1 user             x2, x3

Multiple-group models follow the usual syntax. For example, the metric invariance model for the Holzinger and Swineford data is fitted with group = "school" and group_equal = "loadings", and the tied loadings are estimated by the pooled solve of Section 17.2.5; an example is given for the multiple-group method in Section 17.5.7.

17.4 The James-Stein estimators

The James-Stein estimators (Burghgraeve et al., 2021) take the equation decomposition of Section 17.2.2, but resolve the endogeneity of the marker regressors differently: instead of projecting on instruments, they regress on the conditional expectation of the latent variables given observed proxies. They are requested with estimator = "JS" (the scaling James-Stein estimator, which conditions on the marker of each factor) or estimator = "JSA" (the aggregated James-Stein estimator, which conditions on a reliability-weighted aggregate of the indicators of each factor).

17.4.1 Regressing on conditional expectations

Take a structural equation of Equation 17.2, with the latent dependent variable replaced by its marker, and condition both sides on an observed function f_e(\mathbf{y}) of the data:

\mathrm{E}(y_{1e} \mid f_e) = \alpha_e + \mathbf{a}_e^{\prime}\, \mathrm{E}(\boldsymbol{\eta}_{A_e} \mid f_e) + \boldsymbol{\gamma}_e^{\prime}\, \mathrm{E}(\mathbf{x}_e \mid f_e) + \mathrm{E}(\zeta_e + \epsilon_{1e} \mid f_e).

If the composite error is conditionally mean-zero given f_e, then regressing y_{1e} on estimates of \mathrm{E}(\boldsymbol{\eta}_{A_e} \mid f_e) and \mathbf{x}_e gives consistent coefficients. Seen this way, MIIV-2SLS, JS, and JSA are the same per-equation estimator with three different conditioning sets: the model-implied instruments (for which the conditional expectation is the first-stage fitted value), the markers of the latent regressors, and reliability-weighted aggregates of their indicators.

For a single latent regressor with marker y_1, the conditional expectation under normality is the Kelley shrinkage of the observed score towards the mean (Kelley, 1927),

\mathrm{E}(\eta \mid y_1) = R\, y_1 + (1 - R)\, \mathrm{E}(\eta), \qquad R = \frac{\text{Var}(\eta)}{\text{Var}(y_1)} = 1 - \frac{\text{Var}(\epsilon_1)} {\text{Var}(y_1)},

with R the reliability of the marker. Normality is needed only for the form of the conditional expectation; the resulting coefficient estimator is consistent without it, because it relies on second moments only. The sample version replaces 1 - R by c\,\hat{\theta}_1 / s_{11}, with \hat{\theta}_1 an estimate of the error variance of the marker and c = (N- 3)/(N- 1) the small-sample factor of Efron and Morris (1975) (js_small_sample = TRUE, the default; c = 1 gives the plain attenuation correction).

17.4.2 The moment-form kernel

Regressing on estimated conditional expectations is ordinary covariance algebra; no factor scores are computed. In the one-regressor case, because the conditional expectation is a linear function of y_1, the least squares slope of y_p on it is

\hat{\lambda}_p = \frac{s_{1p}}{\hat{R}\, s_{11}} = \frac{s_{1p}}{s_{11} - c\, \hat{\theta}_1}, \tag{17.11}

the OLS slope with a disattenuated denominator. The whole estimator is attenuation-corrected least squares. Consistency needs \text{Cov}(\epsilon_1, \epsilon_p) = 0: the error of the marker may not be correlated with the error of the dependent variable.

In general, an equation has several latent regressors and observed covariates, and the conditioning must be joint. Let \mathbf{z} = \mathbf{U} \mathbf{y} collect the conditioning variables, one row of \mathbf{U} per regressor: for an observed regressor the row selects the variable itself; for a latent regressor it holds the weights of its proxy (a single marker, or an aggregate). Each latent proxy carries a scale \kappa (one for a marker, \mathbf{w}^{\prime} \boldsymbol{\lambda} for an aggregate) and an error variance \vartheta, so that the proxy equals \kappa\, \eta plus an error. With \mathbf{S}_{zz} = \mathbf{U} \mathbf{S}\mathbf{U}^{\prime} and \mathbf{s}_{zy} the covariances of the conditioning variables with the dependent variable, the covariances \mathbf{G} of the regressors with \mathbf{z} are rows of \mathbf{S}_{zz}, corrected and rescaled on the latent rows (row r belongs to regressor r, and \mathbf{e}_r is the corresponding unit vector),

\mathbf{G}_{r \cdot} = \begin{cases} \mathbf{S}_{zz, r \cdot} & \text{observed regressor,} \\ \bigl( \mathbf{S}_{zz, r \cdot} - c\, \vartheta_r\, \mathbf{e}_r^{\prime} \bigr) / \kappa_r & \text{latent regressor,} \end{cases}

and the normal equations of the regression on the joint conditional expectation are

\mathbf{A} = \mathbf{G} \mathbf{S}_{zz}^{-1} \mathbf{G}^{\prime}, \qquad \mathbf{b} = \mathbf{G} \mathbf{S}_{zz}^{-1} \mathbf{s}_{zy}, \qquad \hat{\boldsymbol{\beta}} = \mathbf{A}^{-1} \mathbf{b}, \tag{17.12}

where \hat{\boldsymbol{\beta}} holds all the coefficients of the equation: the loading of a measurement equation, or \mathbf{a}_e and \boldsymbol{\gamma}_e of a structural equation. Without latent regressors, \mathbf{G} = \mathbf{S}_{zz} and the kernel reduces to OLS. With markers only and no covariates, \mathbf{G} is the symmetric matrix \mathbf{S}_{zz} - c\,\text{diag}(\hat{\boldsymbol{\theta}}), an estimate of the variance matrix of the latent regressors, and Equation 17.12 becomes the multivariate Kelley formula of the 2021 paper. The joint version matters as soon as an observed covariate enters an equation: conditioning the latent regressor on its marker alone while adding the covariate to the regression is inconsistent unless the covariate is independent of the factor given the marker. Fixed coefficients are partialled out before solving, and the pair (\mathbf{A}, \mathbf{b}) is stored per equation for the pooled constrained solve, exactly as for the IV estimator.

The correction of the latent rows of \mathbf{G} subtracts estimated error variances from sample variances, and in small samples the result can be nearly singular, or even indefinite, although its population counterpart is comfortably positive definite. This happens mostly in equations with two or more latent regressors, and the slopes of such an equation then take extreme values. A barrier guards against this, per equation. Let \boldsymbol{\Theta}_z be the diagonal matrix that holds the error variances \vartheta_r of the latent proxies (and zeros for the observed regressors), and let \rho be the smallest root of |\mathbf{S}_{zz} - \rho\, c\, \boldsymbol{\Theta}_z| = 0: the largest multiple of the error variances that can be subtracted before the matrix becomes singular. As long as \rho exceeds one by a margin, nothing happens. Otherwise the correction is truncated: the error variances are multiplied by \rho^{*} = \max(\rho - \text{margin}, 0) instead of one, which shrinks the estimates of the equation towards ordinary least squares. Under the current default (js_lambda_floor = "se"), the margin is two standard errors of \log \rho, with 1/(N- 1) as a minimum, so that the barrier only engages when the data do not support the full correction; a nonnegative number sets a fixed margin, and "none" switches the barrier off. For an equation with a single latent regressor, \rho is the inverse of the unreliability of the proxy, and the barrier engages only when that reliability is not clearly above zero. lavaan prints a note that names the equations in which the multiplier dropped below 0.95. The device is the same as the lambda correction of the SAM approach (Section 18.9.1), and close to the positive-definiteness correction of the multiple-group method (Section 17.5.1).

The conditioning argument requires the disturbance \zeta_e to be independent of the regressors and their ancestors, which holds in a recursive system but fails with a feedback loop. The IV estimator avoids this problem through its instruments; the James-Stein estimators cannot, so the structural part must be recursive, and the disturbance of a dependent variable may not be correlated with an ancestor of one of its regressors.

17.4.3 Reliabilities from tetrads

The kernel needs an estimate \hat{\theta}_p of the error variance of every proxy variable. For a factor with three or more indicators, the communality of indicator p is estimated by averaging tetrad ratios over the pairs (a, b) of the other indicators of the factor,

\hat{h}^2_p = \underset{(a, b)}{\text{mean}}\; \frac{r_{pa}\, r_{pb}} {r_{ab}}, \qquad \hat{\theta}_p = (1 - \hat{h}^2_p)\, s_{pp}, \tag{17.13}

the Spearman estimate of classic factor analysis: for a congeneric factor, every term equals \lambda_p^2 \psi / s_{pp} in the population. The estimate is clipped to a wide interval (js_theta_bounds = "wide") and \hat{\theta}_p to [0, s_{pp}]. Tetrads that run through an active residual covariance are excluded (Section 17.4.5). When no clean within-factor tetrad remains, or when a factor has only two indicators, the third variable of the tetrad may be any clean observed variable z outside the factor: in the ratio r_{pa} r_{pz} / r_{az} the unknown covariance between the factor and z cancels, provided it is nonzero. This is the device of Kano (1990), and it is what makes factors with two indicators feasible, as long as the factor is correlated with the rest of the model. Factors with fewer indicators use a residual variance that is fixed in the model (the default rule for a single-indicator factor fixes it to zero, so the latent variable coincides with its indicator), and the user can supply reliabilities directly (js_theta = "user" with js_theta_values).

17.4.4 Aggregated proxies

The scaling estimator conditions on one indicator per factor and leaves the information in the others unused. The aggregated estimator conditions on a weighted sum \mathbf{w}^{\prime} \mathbf{y}_{(m)} of the pure indicators of each latent regressor, with the weights that maximize the reliability of the aggregate,

\min_{\mathbf{w}}\; \frac{\mathbf{w}^{\prime} \hat{\boldsymbol{\Theta}}_{(m)} \mathbf{w}}{\mathbf{w}^{\prime} \mathbf{S}_{(m)} \mathbf{w}},

the alphamax weights of Bentler (1968), obtained in closed form as the generalized eigenvector with the smallest eigenvalue (normalized to sum to one). The aggregate is one more proxy row of \mathbf{U}, with \kappa = \mathbf{w}^{\prime} \hat{\boldsymbol{\lambda}}_{(m)} and \vartheta = \mathbf{w}^{\prime} \hat{\boldsymbol{\Theta}}_{(m)} \mathbf{w}; the loadings come from a preceding scaling pass, so the first stage always runs the scaling estimator first and the aggregated one second. In the measurement equation of y_p, the aggregate for its own factor excludes y_p. A useful identity: for a factor with three indicators, the alphamax-weighted JSA slope is algebraically identical to the scaling JS slope, so the two estimators differ only for factors with four or more indicators.

17.4.5 Residual covariances

The identity behind the kernel, that covariances with a latent variable are covariances with its marker corrected for the marker’s own error, fails wherever errors are correlated. An active residual covariance contaminates the regression moment (if the dependent variable shares error with a proxy), the tetrads (every tetrad through the contaminated pair, which biases the reliability and hence every equation conditioning on that marker), and the off-diagonal of \mathbf{G} (two proxies with correlated errors). The remedy is the James-Stein analog of dropping contaminated instruments: per-equation clean conditioning sets. A proxy variable is inadmissible for an equation when it shares error with the equation’s dependent variable, when its reliability is not estimable, or when it shares error with another proxy of the same equation. An inadmissible marker is replaced by an alphamax aggregate of clean pure indicators of the same factor, scaled by their estimated loadings, so the aggregation machinery is reused inside the scaling estimator. Which tetrads are clean and which proxies are admissible is decided from the model structure alone (the pattern of the residual covariances), never from the data. The layout of the computation is therefore the same in every sample, and the estimation map stays a smooth function of the moments, which the standard errors require. Models without residual covariances are unaffected. The residual covariances themselves are estimated in the second stage. When a needed reliability has no clean tetrad left, or an equation no clean proxy for one of its latent regressors, an informative error is raised.

17.4.6 Standard errors for the James-Stein estimators

The complete estimator (tetrads, weights, conditioning plans, stage-1 solves, pooled constraints, stage 2, mean solve) is differentiated in one forward-mode chain-rule sweep (js_jacobian = "analytic", the current default). Each piece has a closed form: the tetrads are rational functions of four sample moments; the alphamax weights are differentiated through the bordered system of the generalized eigenproblem; the kernel through matrix calculus; the pooled solve through Equation 17.4; and the RLS second stage, which is a fixed point, through the implicit function theorem. Because the sweep runs through all steps, the additional variability caused by estimating the reliabilities (Theorem 2 of Burghgraeve et al. (2021), for which the paper had to fall back on the bootstrap) and the aggregation weights is captured automatically. The layout of the computation is fixed by the model (Section 17.4.5), but a few numerical safeguards inside it do depend on the data: a communality or an error variance that is clipped at its bound, aggregation weights that fall back to equal weights (or an aggregate that falls back to the marker) when the alphamax problem is degenerate, and the truncation of the measurement-error correction in an equation whose corrected matrix is close to singular (the barrier of Section 17.4.2). These safeguards are inactive in well-behaved samples. When one of them is active, the map is still smooth around the observed moments, but along another branch. The point map is therefore first re-run with a recorder that stores the branches actually taken, and the derivative pass replays them, so that the derivative always belongs to the path that produced the estimates: equal weights, for example, are constant and have a zero derivative, and the truncation multiplier is held fixed, so that the standard errors are conditional on it. The analytic Jacobian is not only faster but also more accurate than numerical differentiation, since the latter differentiates the finitely iterated RLS map. A few configurations (general linear constraints among the variances, a non-convergent second-stage weight matrix) fall back to the numerical Jacobian.

17.4.7 Example

The James-Stein estimators apply to the Political Democracy model of Section 17.3.8 without changes; the structural part is recursive, and every factor has a marker:

fit_js  <- sem(model_pd, data = PoliticalDemocracy, estimator = "JS")
fit_jsa <- sem(model_pd, data = PoliticalDemocracy, estimator = "JSA")
pe_js  <- parameterEstimates(fit_js)
pe_jsa <- parameterEstimates(fit_jsa)
cbind(pe_ml[idx, c("lhs", "op", "rhs")],
      ML  = round(pe_ml$est[idx], 3), IV  = round(pe_iv$est[idx], 3),
      JS  = round(pe_js$est[idx], 3), JSA = round(pe_jsa$est[idx], 3))
     lhs op   rhs    ML    IV    JS   JSA
12 dem60  ~ ind60 1.474 1.261 1.618 1.323
13 dem65  ~ ind60 0.453 1.123 1.058 0.922
14 dem65  ~ dem60 0.864 0.724 0.819 0.749

The scaling and aggregated estimators differ here because the democracy factors have four indicators each. The summary() header of a James-Stein fit shows the common language of the family:

summary(fit_jsa, estimates = FALSE)
lavaan 0.7-4 ended normally after 1 iteration

  Estimator                                        JSA
  Optimization method                          Noniter
  Number of model parameters                        25

  Number of observations                            75

Model Test User Model:
                                                      
  Browne's residual-based (NT) test                   
  Test statistic                                54.570
  Degrees of freedom                                41
  P-value (Chi-square)                           0.076

The standard errors are delta-method expressions with the normal-theory moment covariance, as reported in the parameter section of the full summary() output (not shown here); se = "robust" would switch to the distribution-free one. The options of the estimator are listed on the estimator_js help page.

17.5 The multiple-group method

The multiple-group method of Guttman (1944, 1952) is the oldest of the three first stages and the only one that does not use the equation decomposition. “Multiple group” refers to groups of indicators, not to multiple samples: under a CFA structure with simple structure, the indicators can be partitioned according to the factor they load on, and the sum scores of these groups give closed-form expressions for the loadings and the factor correlations. In the evaluation of non-iterative CFA estimators by Dhaene and Rosseel (2023), the method was the most consistently favorable performer, despite its age. The implementation in lavaan (estimator = "MGM", aliases "guttman" and "guttman1952") extends the method to multiple samples with measurement-invariance constraints (Dhaene et al., 2026), residual covariances, cross-loadings, factors without a marker, and restricted factor covariance matrices. It remains restricted to CFA models: no structural part, no higher-order factors, continuous single-level data.

17.5.1 The classic algorithm

Let \mathbf{X} be the P\times M pattern matrix with x_{pm} = 1 when indicator p loads on factor m. The method works on the reduced sample covariance matrix, in which the diagonal is replaced by communalities:

\mathbf{S}^{*} = \mathbf{S}- \hat{\boldsymbol{\Theta}}_0, \qquad \hat{\boldsymbol{\Theta}}_0 = \text{diag}(\hat{\theta}_1, \ldots, \hat{\theta}_{P}),

with \hat{\boldsymbol{\Theta}}_0 the Spearman tetrad estimate Equation 17.13 (with external tetrads for two-indicator factors, as in Section 17.4.3). In the population, \boldsymbol{\Sigma}- \boldsymbol{\Theta}= \boldsymbol{\Lambda}\boldsymbol{\Psi}\boldsymbol{\Lambda}^{\prime}, and everything the method does is linear algebra on this reduced matrix; the quality of \hat{\boldsymbol{\Theta}}_0 is its only statistical ingredient. The sum scores per group of indicators give

\mathbf{L}_0 = \mathbf{X}^{\prime} \mathbf{S}^{*}, \qquad \mathbf{P}_0 = \mathbf{X}^{\prime} \mathbf{S}^{*} \mathbf{X}, \qquad \mathbf{D} = \text{diag}(\mathbf{P}_0),

the covariances of every indicator with every sum score, and the covariances among the sum scores. Normalizing to unit-variance sum scores, \mathbf{L} = \mathbf{D}^{-1/2} \mathbf{L}_0 and \mathbf{P} = \mathbf{D}^{-1/2} \mathbf{P}_0 \mathbf{D}^{-1/2}, the unconstrained pattern solution is the regression of each indicator on all normalized sum scores,

\boldsymbol{\Lambda}^{*} = \mathbf{L}^{\prime} \mathbf{P}^{-1}, \tag{17.14}

followed by a rescale to the marker metric, \hat{\boldsymbol{\Lambda}} = \boldsymbol{\Lambda}^{*} \mathbf{M}^{-1} with \mathbf{M} the diagonal matrix of the marker rows of \boldsymbol{\Lambda}^{*}, which sets the marker loadings to one exactly. The factor covariance matrix follows either from the sum scores, \hat{\boldsymbol{\Psi}} = \mathbf{M} \mathbf{P} \mathbf{M} (the current default), or from the Bartlett mapping \mathbf{M}_B = (\hat{\boldsymbol{\Lambda}}^{\prime} \hat{\boldsymbol{\Theta}}_0^{-1} \hat{\boldsymbol{\Lambda}})^{-1} \hat{\boldsymbol{\Lambda}}^{\prime} \hat{\boldsymbol{\Theta}}_0^{-1} as \hat{\boldsymbol{\Psi}} = \mathbf{M}_B \mathbf{S}^{*} \mathbf{M}_B^{\prime} (psi_mapping = TRUE, which is also what sam() uses). The residual variances are \hat{\boldsymbol{\Theta}}_0, unless the second stage re-estimates them.

The reason why this works is as follows. Dropping the normalizations and evaluating at exact moments, \boldsymbol{\Lambda}^{*} = \mathbf{S}^{*} \mathbf{X} (\mathbf{X}^{\prime} \mathbf{S}^{*} \mathbf{X})^{-1} = \boldsymbol{\Lambda} \mathbf{G} with

\mathbf{G} = \boldsymbol{\Psi}\mathbf{A}^{\prime} (\mathbf{A} \boldsymbol{\Psi} \mathbf{A}^{\prime})^{-1}, \qquad \mathbf{A} = \mathbf{X}^{\prime} \boldsymbol{\Lambda}. \tag{17.15}

The sum scores lose none of the loading information, only an unknown M\times M mixing \mathbf{G}. Under simple structure, \mathbf{A} is diagonal (each composite sums loadings of its own factor only), so \mathbf{G} is diagonal, \boldsymbol{\Lambda}^{*} equals the true loading matrix up to column scaling, and the marker rescale removes that scaling. This is why the classic method is consistent, and Equation 17.15 also shows what breaks with cross-loadings (Section 17.5.4).

With Spearman communalities, \mathbf{S}^{*} lies on the boundary of positive semi-definiteness. When the smallest root \rho of |\mathbf{S}- \rho \hat{\boldsymbol{\Theta}}_0| = 0 falls below 1 + 1/(N - 1), the subtraction is shrunk, \mathbf{S}^{*} = \mathbf{S}- \rho^{*} \hat{\boldsymbol{\Theta}}_0 with \rho^{*} = \rho - 1/(N- 1), which keeps the reduced matrix positive definite. This correction is almost always active, vanishes at rate 1/N, and is a finite-sample regularization rather than part of the estimand.

17.5.2 Equality constraints and multiple samples

The multi-sample extension of Dhaene et al. (2026) imposes the zero pattern and the equality constraints through a quadratic program over the stacked rows of \boldsymbol{\Lambda}^{*}. In lavaan that program has been replaced by its closed-form solution. Restricted to the free cells, the Hessian of the program is block-diagonal over rows, and under simple structure each row has one free cell with quadratic coefficient \mathbf{P}_{mm} = 1. Hence the unconstrained solution of a pattern cell is simply its normalized structure coefficient l_{pm}; tied cells (within a factor, or the same cell across samples) receive the plain average of their normalized coefficients; and the final metric divides by the normalized marker loading, pooled over the samples that are joined by a tie:

\hat{\lambda}_{pm} = \frac{\text{mean of } l_{pm} \text{ over the tie class}}{\text{mean of } l_{\text{marker}(m)} \text{ over the pooled samples}}.

Configural models are therefore computed per sample and equal the separate single-sample fits exactly. Under metric invariance (group_equal = "loadings"), the pooled markers make the tied loadings identical across samples by construction, and partial invariance (group_partial) works, since a freed cell forms its own singleton class. Scalar invariance is handled by the joint mean solve of Section 17.2.4. Ties across different factors are refused: the normalized metric is factor-specific. With ties, the positive-definiteness correction is computed jointly over the samples; without ties, per sample.

17.5.3 Correlated residuals

A free residual covariance \theta_{pp'} puts \lambda_p \lambda_{p'} \psi + \theta_{pp'} in cell (p, p') of the sample covariance matrix, and the row sums, the sum-score covariances, and the tetrads that touch the cell are all contaminated; the classic estimator is then inconsistent. The remedy is non-iterative: estimate each \theta_{pp'} directly and subtract it before anything else runs. The common-factor part of the contaminated cell is identified by a tetrad ratio over clean anchor cells (a, b),

\frac{s_{pa}\, s_{p'b}}{s_{ab}} = \lambda_p \lambda_{p'}\, \psi_{f_p f_{p'}},

whenever the anchor factors are admissible: for a within-factor pair, at least one anchor must belong to the same factor; for a between-factor pair, both anchors must belong to the two factors involved, in either of the two orientations but not the one that leaves a ratio of three factor covariances. The estimate is the average over all admissible anchor pairs whose three cells are themselves clean, and the purged matrix replaces the cell by that average. After purging, everything else is unchanged, and the residual covariances themselves are estimated by the second stage, which is switched on automatically. Pairs without clean anchors are flagged with a warning.

17.5.4 Cross-loadings

With cross-loadings, \mathbf{A} and hence \mathbf{G} in Equation 17.15 acquire off-diagonal entries, and the columns of \boldsymbol{\Lambda}^{*} mix. No reweighting can undo the mixing; but \boldsymbol{\Lambda}^{*} = \boldsymbol{\Lambda}\mathbf{G} still spans the true loading space, and the mixing is recoverable from the model’s own zero pattern by a rotation. Writing \mathbf{H} = \mathbf{G}^{-1}, column \mathbf{h}_m solves

\min_{\mathbf{h}}\; \| \boldsymbol{\Lambda}^{*}_{[Z_m, \cdot]}\, \mathbf{h} \|^2 \qquad \text{subject to} \qquad \boldsymbol{\Lambda}^{*}_{[\text{marker}(m), \cdot]}\, \mathbf{h} = 1,

where Z_m collects the clean rows (indicators without cross-loadings and without an unpurged residual covariance) that have a specified zero on factor m: one small bordered system per factor, an oblique target rotation to the model’s pattern. At exact moments the minimum is zero and the rotation is exact. The construction is practical because of an immunity property: a wrong communality for a cross-loading indicator perturbs only its own row of \boldsymbol{\Lambda}^{*}, so the clean rows are reproduced exactly regardless of the (biased) Spearman value of the cross-loaders. The factor covariance matrix is then obtained from the Bartlett mapping restricted to the clean rows, each cross-loading row is re-estimated by a small least squares solve against sum scores that exclude all cross-loaders (Guttman’s own regression-on-composites logic with the contaminated variables masked), and the residual variances of the cross-loaders follow from the model identity. Markers must be free of cross-loadings, and the positive-definiteness correction is switched off in this branch, since it would perturb the clean diagonal cells.

17.5.5 Factors without a marker

Rescaling a factor, \boldsymbol{\Lambda}\to \boldsymbol{\Lambda}\mathbf{D}_s and \boldsymbol{\Psi}\to \mathbf{D}_s^{-1} \boldsymbol{\Psi}\mathbf{D}_s^{-1}, leaves the implied covariance matrix untouched, so the metric is a free coordinate that can be fixed last. A factor without a fixed loading receives a provisional marker, the machinery runs in the provisional metric, and each factor is afterwards rescaled by s_m = c for a loading fixed to c, or s_m = \sqrt{\hat{\psi}_{mm} / v} for a factor variance fixed to v (std_lv = TRUE fixes v = 1). When \boldsymbol{\Psi} is otherwise saturated, the std_lv solution is the exactly transformed marker solution. Restrictions that the rescale cannot absorb (orthogonal = TRUE, a fixed factor covariance, equality ties among the factor variances) are handled as sam() handles its structural model: the saturated stage-1 estimates \hat{\boldsymbol{\Psi}}_g are treated as data, and the restricted matrix is obtained by projecting onto the model,

\hat{\mathbf{x}} = \arg\min_{\mathbf{x}} \sum_g w_g \Bigl( \log | \boldsymbol{\Psi}_g(\mathbf{x}) | + \text{tr}\, \boldsymbol{\Psi}_g(\mathbf{x})^{-1} \hat{\boldsymbol{\Psi}}_g \Bigr), \qquad w_g = N_g / N,

a small smooth problem in the free cells. The measurement side never re-enters, in the spirit of the SAM approach: measurement first, structure second.

17.5.6 Standard errors for the multiple-group method

The multiple-group method uses the generic delta-method engine of Section 17.2.6. Its Jacobian is analytic for the main branches. In the classic case, with \mathbf{W} = \mathbf{S}- \rho^{*} \hat{\boldsymbol{\Theta}}_0, \mathbf{T} = \mathbf{X}^{\prime} \mathbf{W} \mathbf{X}, \mathbf{U} = \mathbf{W} \mathbf{X} \mathbf{T}^{-1}, and u_m the marker entry of column m of \mathbf{U}, the whole solve collapses to \hat{\lambda}_{pm} = U_{pm} / u_m and \hat{\psi}_{mm'} = T_{mm'}\, u_m u_{m'}: smooth rational functions of the moments, whose derivatives are chained with those of the tetrads and of the positive-definiteness root. The pooled, purged, cross-loading, rescaled, and projected branches each add their own chain; the second stage and the mean solve reuse the James-Stein derivative code. A built-in check compares the predicted estimates of the analytic formulas with the actual ones and falls back to the numerical Jacobian on any mismatch, as for the cases that are not covered (cross-loadings combined with ties, pinned nonzero cells together with a second stage). For 60 indicators, the analytic route takes a fraction of a second where the numerical one takes ten. The mgm_gamma option selects the flavor of \boldsymbol{\Gamma} ("nt" or "adf").

17.5.7 Example

The Holzinger and Swineford CFA model illustrates the method. The summary() header again shows the common language of the family:

model_hs <- '
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9
'
fit_mgm <- cfa(model_hs, data = HolzingerSwineford1939, estimator = "MGM")
summary(fit_mgm, estimates = FALSE)
lavaan 0.7-4 ended normally after 1 iteration

  Estimator                                        MGM
  Optimization method                          Noniter
  Number of model parameters                        21

  Number of observations                           301

Model Test User Model:
                                                      
  Browne's residual-based (NT) test                   
  Test statistic                                86.556
  Degrees of freedom                                24
  P-value (Chi-square)                           0.000

The main strength of the method in Dhaene and Rosseel (2023) is its behavior on ill-conditioned models. With only two indicators for the speed factor, ML runs into a Heywood case, while the multiple-group method (using an external tetrad for the two-indicator factor) stays proper:

model_hs2 <- '
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8
'
fit_ml2  <- cfa(model_hs2, data = HolzingerSwineford1939)
Warning: lavaan->lav_object_post_check():  
   some estimated ov variances are negative
fit_mgm2 <- cfa(model_hs2, data = HolzingerSwineford1939,
                estimator = "MGM")
round(cbind(ML = coef(fit_ml2), MGM = coef(fit_mgm2)), 3)[
  c("speed=~x8", "x8~~x8"), ]
              ML   MGM
speed=~x8  3.005 1.157
x8~~x8    -0.586 0.365

Multiple samples with measurement-invariance constraints use the standard syntax; the tied loadings are the averages of Section 17.5.2:

fit_mgm_metric <- cfa(model_hs, data = HolzingerSwineford1939,
                      estimator = "MGM", group = "school",
                      group_equal = "loadings")
fitMeasures(fit_mgm_metric, c("chisq", "df", "pvalue", "cfi", "rmsea"))
  chisq      df  pvalue     cfi   rmsea 
112.336  54.000   0.000   0.730   0.085 

Finally, the option estimator_args = list(crossload_detect = TRUE) enables a data-driven forward search that frees omitted cross-loadings flagged by an expected-parameter-change and z-statistic screen (crossload_epc, crossload_z, crossload_max). This is a convenience for exploratory use, to be handled with the caution that applies to any data-driven specification search:

fit_mgm_cl <- cfa(model_hs, data = HolzingerSwineford1939,
                  estimator = "MGM",
                  estimator_args = list(crossload_detect = TRUE))
lavaan NOTE:  
   MGM cross-loading detection freed the following loading(s): visual =~ x9, 
   textual =~ x3.
subset(parameterEstimates(fit_mgm_cl, ci = FALSE, output = "text"),
       op == "=~")
Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  visual =~                                           
    x1                1.000                           
    x2                0.780    0.166    4.691    0.000
    x3                1.201    0.316    3.803    0.000
  textual =~                                          
    x4                1.000                           
    x5                0.848    0.199    4.266    0.000
    x6                0.950    0.155    6.125    0.000
  speed =~                                            
    x7                1.000                           
    x8                1.132    0.179    6.338    0.000
    x9                0.648    0.106    6.121    0.000
  visual =~                                           
    x9                0.455    0.136    3.337    0.001
  textual =~                                          
    x3               -0.268    0.161   -1.664    0.096

The output shows that two cross-loadings were added: visual =~ x9 and textual =~ x3.

17.6 Two older non-iterative CFA estimators

Two further non-iterative estimators for CFA models are kept in lavaan for reference. Factor analysis by instrumental variables (FABIN; Hägglund (1982)) exploits the same instrumental-variable logic as MIIV in a CFA setting; the two variants estimator = "fabin2" (OLS) and "fabin3" (2SLS) are retained because they were used in Dhaene and Rosseel (2023), and because FABIN3 provides the starting values for the factor loadings (Section 6.1.4). Bentler’s method [Bentler (1982); estimator = "bentler1982"] is based on a block partitioning of \mathbf{S} that separates markers from non-markers, and was the first to handle fixed and free parameters in the model matrices systematically. Neither provides analytic standard errors (the bootstrap remains available), and neither supports constraints, multiple groups, or missing data. For new analyses, the three estimators of this chapter supersede them.

17.7 Choosing an estimator

Table 17.2 summarizes what the three first stages support in version 0.7-4. The first six rows are properties of the shared architecture; the remaining rows are where the first stages differ.

Table 17.2: Capabilities of the three multi-stage estimators.
Feature IV JS/JSA MGM
moments-only input (sample_cov) yes yes yes
multiple groups, invariance constraints yes yes yes
simple and general linear equality constraints yes yes simple only
two-stage missing data yes yes yes
analytic delta-method standard errors yes yes yes
Browne residual-based test yes yes yes
structural regressions yes yes, recursive no
higher-order factors yes no no
ordered categorical indicators yes no no
factors without a marker (std_lv = TRUE) no no yes
residual covariances, cross-loadings yes yes yes
sampling weights yes (moments engine) no yes
conditional_x = TRUE, multilevel no no no

Within the family, the IV estimator is the most general and the most thoroughly studied. Its instruments are also its weakness: with many instruments 2SLS is biased, which LIML repairs, and with few strong instruments an equation may not be identifiable at all. The James-Stein estimators need no instruments and have no weak-instrument pathology; in the simulations of Burghgraeve et al. (2021), JSA is competitive with and often better than ML and MIIV in mean squared error at small sample sizes. The multiple-group method is restricted to CFA, but it is the most robust of the non-iterative CFA estimators and it stays admissible where ML does not. All three are consistent under non-normality of the factors, and all three trade some efficiency under a correct model for locality under a wrong one. Relative to the SAM approach of chapter 18, which also estimates the measurement part first, the multi-stage estimators have no second-step structural fit: the structural coefficients are obtained equation by equation, by the same first stage as the loadings. The two approaches meet in sam(), whose measurement blocks can be estimated by any of the three estimators of this chapter (through its mm_args argument, Section 18.2.1); the structural part is then still estimated in a separate second step. In that case, sam() provides two-step corrected standard errors that use the moment Jacobian of the estimator (Section 17.2.6) as the step-1 influence.

17.8 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.

All non-iterative estimators enter through one dispatcher, which checks the unsupported features (multilevel data, nonlinear and inequality constraints, and equality constraints for the legacy estimators), calls the estimator-specific driver, and returns the solution flagged as converged after one “iteration”. The IV and James-Stein drivers share the equation decomposition, the pooled constrained solve, the second stage, and the mean solve; the James-Stein derivative code for the second stage and the mean solve is reused by the multiple-group method. The delta-method engine of Section 17.2.6 is generic: any non-iterative estimator can join it by providing a branch that re-runs its estimation map on a perturbed moment vector. The per-equation information of the IV and James-Stein estimators is stored in the fitted object and returned by lavInspect(fit, "eqs"). Table 17.3 maps the procedures of this chapter to their source files.

Table 17.3: Source files behind the multi-stage estimators.
Topic File(s)
dispatcher for the non-iterative estimators (lav_optim_noniter()) lav_optim_noniter.R
generic delta-method engine (lav_noniter_vcov(), lav_noniter_jacobian()), summary header rows, MGM analytic Jacobian (lav_cfa_mgm_jacobian()) lav_optim_noniter_vcov.R
equation decomposition and instrument search (lav_model_find_iv()), |~ handling, weak-instrument diagnostics lav_model_find_iv.R
IV driver, both engines (lav_sem_miiv_2sls(), lav_sem_miiv_2sls_samp()), pooled solve (lav_sem_miiv_apply_directed_pool()), second stage (lav_sem_miiv_varcov()), mean solve (lav_sem_miiv_mean_wls()), vcov assembly lav_sem_miiv.R
IV analytic Jacobians, k-class helpers, per-equation Browne test lav_sem_miiv_utils.R
James-Stein driver, kernel, tetrads, alphamax weights, conditioning plans lav_sem_js.R
James-Stein analytic Jacobian (one chain-rule sweep) lav_sem_js_deriv.R
multiple-group method: classic blocks, purge, cross-loading rotation, restricted-\boldsymbol{\Psi} fit, orchestrator (lav_cfa_guttman1952_internal()) lav_cfa_guttman1952.R
Spearman communalities (lav_cfa_theta_spearman()) lav_cfa_utils.R
FABIN and Bentler’s 1982 method lav_cfa_fabin.R
lav_cfa_bentler1982.R
estimator-specific options and their defaults lav_options_estimator.R
the sandwich identity without forming \boldsymbol{\Gamma} (lav_mat_k_gammant_kt()) lav_matrix.R