Lavaan (CFA, SEM): Are Your Models Equivalent?

by Arndt Regorz, MSc.
October 01, 2024

One important concept in CFA and SEM is the concept of equivalent models. There are often many different models that have the same mathematical properties. They can't be distinguished statiscally, they will show exactly the same model fit.

This is important because by showing a good model fit for your model you have not shown in any way that this model is true. Maybe another, equivalent model (which would have the same model fit) is the true model.

But how can you assess whether two (or more) models are equivalent? With a lavaan model there is a simple function from the semTools package that allows you to make that assessment.

1. When Are Models Equivalent?

Let's look at the following two CFA-Models:

Figure 1

CFA Examples

equivalent 1

Even though these two models look quite differently, they are essentially the same model, they are equivalent.

In model 1 the two factors visual and speed have a perfect correlation of 1. And both their correlations with the third factor, textual, is exactly the same. Thus, they are not functioning as two different factors but as one factor.

It is not always easy to make that assessment just by looking at the models. Here the function net() from the semTools package comes into play.

2. Checking Lavaan Models for Equivalence

In order to check whether the two models introduced above are equivalent, first we specify and estimate these models.

library(lavaan)
library(semTools)

model_1 <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9

visual ~~ 1 * speed
visual ~~ a * textual
speed ~~ a * textual
'

cfa_fit_1 <- cfa(model_1, data = HolzingerSwineford1939, std.lv = T)

model_2 <- ' visual_speed =~ x1 + x2 + x3 + x7 + x8 + x9
textual =~ x4 + x5 + x6
'

cfa_fit_2 <- cfa(model_2, data = HolzingerSwineford1939, std.lv = T)

Then, we use the net() function from the semTools library to check whether the two models are equivalent:

net(cfa_fit_1, cfa_fit_2)

As an output we get (after some explanatory text):


Figure 2

Output from the net() function

equivalent 2

Two models are equivalent, if they are nested and have the same degrees of freedom.

Here we can see that both models have the same degrees of freedom (df = 26) and that they are nested ("TRUE"). Therefore, these two models are equivalent models.

Citation

Regorz, A. (2024, October 01). Lavaan (CFA, SEM): Are Your Models Equivalent?. Regorz Statistik. https://www.regorz-statistik.de/blog/lavaan_equivalent_models.html