Structural Equation Modeling – How to Plot Congeneric Lavaan Model in R

confirmatory-factorlatent-variablelavaanrstructural-equation-modeling

I would like to produce this type of figure from the article "Thinking twice about sum scores".

Figure 3 shows the path diagram of a congeneric model for the same data used in Fig. 1. The major difference is that the loadings from the latent true score to each observed item score are now uniquely estimated for each item, as are the error variances for each item (noted by the subscripts on the parameter labels represented by Greek letters). In order to uniquely estimate the loadings for each item, the variance of the latent true score is constrained to a specific value (1.0 is a popular value to give this latent variable a standardized metric).

enter image description here

Is this the correct model specification for the type of model shown in the figure?

library(lavaan)
library(semPlot)
library(lavaanPlot)


model <- '
    visual =~ x1 + x2 + x3
  '

fit <- cfa(model, data = HolzingerSwineford1939)

semPlot::semPaths(fit)
lavaanPlot::lavaanPlot(model=fit)

This is proof of concept for a more complicated example, so it does not worry me that making a latent factor out of these three indicators might not make sense, be robust, etc. I'm more interested in the model specification and plotting.

Best Answer

The default in lavaan::cfa() is to set the latent scale by fixing the first loading to 1. To instead standardize the latent variable (and estimate the first and other loadings), set the argument std.lv=TRUE.

fit <- cfa(model, data = HolzingerSwineford1939, std.lv = TRUE)

Alternatively, you can do this manually in the ?model.syntax

model <- '
  visual =~ NA*x1 + x2 + x3
  visual ~~ 1*visual
'

https://lavaan.ugent.be/tutorial/syntax2.html

Related Question