Multigroup Analysis

A multigroup analysis fits the same model in two or more groups (for example, women and men) and tests whether its parameters differ across groups. The examples use the scored version of the simulated dataset described in Example Data, in which A4 and A11 are already reverse-scored, with gender as the grouping variable. Because some items are missing, every model uses missing = "fiml", which MLR supports; otherwise lavaan would drop every participant with a missing item.

The code on this page runs in your browser and prints its output when the page loads. The first visit downloads lavaan, so the first results take a while to appear. FIML with MLR is slow in the browser: the cells on this page take a minute or more to finish there, several times longer than in R on your computer. You can edit any cell and run it again.

1. Measurement Invariance Testing (if you use latent variables)

Gradually constrain more parameters to be equal across groups, and test at each step whether the fit gets significantly worse:

  1. Configural invariance: the same factor structure is imposed on all groups, and all parameters are free.
  2. Weak (metric) invariance: the factor loadings are constrained to be equal across groups. You need it before you compare regression paths or covariances between latent variables.
  3. Strong (scalar) invariance: the factor loadings and intercepts are constrained to be equal across groups. You need it before you compare latent means.
  4. Strict invariance: the residual variances are also constrained to be equal (group.equal = c("loadings", "intercepts", "residuals")). It is not needed to compare latent means or paths, so it is often skipped. It matters if you compare the variances of observed scores across groups, because unequal residual variances change them.

If a step fails, you can try partial invariance (section 3) before you go on.

lavTestLRT() compares the models in order: the first test compares the configural model with the weak invariance model, and the second compares the weak with the strong invariance model. With estimator = "MLR", these are scaled chi-square difference tests.

Only when a p-value is non-significant (no significant loss of fit) is that level of invariance supported. Here both p-values are non-significant (.62 and .46), so weak and strong invariance hold, and you can go on to compare path coefficients and latent means across the groups. If the first p-value were significant, weak invariance would not be supported; if the second were significant, strong invariance would not be, and it would be unwise to compare the latent means directly across the groups (see the lavaan tutorial).

The chi-square difference test is sensitive to sample size: in a large sample, even trivial differences are significant. Many papers therefore also report the change in CFI, where a drop larger than .01 suggests that invariance does not hold (Cheung & Rensvold, 2002):

Here the robust CFI is .991, .992, and .992, so it does not drop at all.

2. Compare Path Coefficients

Once weak invariance holds, add the structural paths and compare a model in which the paths are free with a model in which they are equal across groups. Both models keep the loadings equal, so the only difference between them is the paths.

A significant difference means at least one path differs between the groups. Here it does not (p = .63).

3. Optional: Partial Invariance and Single Parameters

Partial invariance

If weak or strong invariance fails, you can free the parameters that differ between the groups and keep the rest equal: this is partial invariance. group.partial lists the parameters to free, for example the intercept of A4. Report which parameters you freed.

Constrain one path to be equal

To test a single path instead of all of them, give it the same label in every group with c() (one label per group) and compare with the model in which it is free (see the lavaan tutorial):

Resources & References

Cheung, G. W., & Rensvold, R. B. (2002). Evaluating goodness-of-fit indexes for testing measurement invariance. Structural Equation Modeling: A Multidisciplinary Journal, 9(2), 233-255. https://doi.org/10.1207/S15328007SEM0902_5