What is the R package lavaan?

Structural equation modeling in lavaan package is fantastic, and the lavaan itself is incredibly widespread package for latent variables modelling analysis. The Lavaan abbreviation means exactly „latent variables analysis” and is a package of statistical libraries dedicated to structural equation modeling analysis and factor model analysis based on exploration/testing convergence between theoretical variance–covariance matrix and the same matrix derived from collected data. This modelling method, despite its superlatives, also has its limitations and flaws (statistical and theoretical) - if you want to read more about it -> (Tarka, 2017). Besides, structural equation modeling lavaan analysis in lavaan package, and also in other programs (Lisrel, Amos, Mplus) stands in opposition to partial least-squares modelling method (PLS), which is prediction oriented, not to confirmation. Partial least squares path modeling (Garson, 2016; Vinzi et al., 2010). PLS method reached its implementation to R in a package ‘plspm’ (Sanchez, 2013) (this is also very good package providing many data visualization methods, especially dedicated to measurement and structural model results presentation) or “cSEM” (Schubert, 2021).Structural equation modeling pls

Structural equation modeling pls

A potential of statistical data analysis in lavaan package

However, getting back to structural equation modeling analysis in lavaan package, this package gives us incredible possibilities to perform analysis of theoretical models in different methodological designs, also using various forms of results estimations.Structural equation modeling pls

Thanks to the specific syntax in lavaan package we can perform analysis concerning:

  1. Modeling confirmatory factor analysis (also second order constructs or different conceptualized models).
  2. Structural equations modeling analysis/ path analysis.
  3. Multigroup analysis (model testing based on data from various study groups).
  4. Latent growth curve analysis (LGCA) (e.g. resulting from timeline or events progress). In such case, we may set random intercepts (random effects of means) and random slopes (random regression slopes).
  5. Analysis based on variance–covariance matrix alone.
  6. Mediation and moderation effects analysis (also moderated mediation effects).
  7. Testing multiple structural equations models.
  8. Testing different types on invariance (metric invariance, scalar invariance, strict invariance, slopes invariance, intercepts invariance etc.).
  9. Constraining model parameters (e.g. path estimates, mediation effects).
  10. Modification indices analysis (calibration of model fit).
  11. Multi-level structural equations modeling analysis in the case of clustered data (lavaan package allows setting random effects of model intercepts). Nevertheless, data have to be continuous (in some cases binomial), and also complete).
  12. Beautiful models visualization via „semPlot” package or „tidySEM”.

Partial least squares path modeling

The most interesting things in lavaan package are various model estimation methods, especially those/these robust e.g. MLMVS - maximum likelihood estimation with robust standard errors and a mean- and variance adjusted method, or special estimation method for binomial dependent variabels. Partial least squares path modeling

Structural equation modeling in lavaan package as a good solution for begginers

Lavaan is much better than other packages and R libraries, simply because it don’t rather require expert knowledge about R. lavaan package was designed to be easy in use for people, who do not work in R on a daily basis. Using lavaan, you can make a graph presenting confirmatory factor analysis, right from the start. Structural equation modeling pls.Below, I present a cool tutorial how to make a great path diagrams in lavaan and corresponding semPlot package. More about visualization of structural models and confirmatory factor analysis you can find HERE.


Check our pretty visualisation methods for CFA and SEM models ;d (click the figure below):



Structural equation modeling lavaan