Skip to content
cicadawing edited this page Sep 24, 2024 · 7 revisions

lavaan

lavaan is a freely available R package for structural equation modelling - which IMO serves as the main competition against MPlus.

lavaan is wonderful because it is free. It has a massive user base - and there is an open Google conversations group free to access and post to. Developers consistently engage with users there for free advice.

At NSB, many of us prefer lavaan over MPlus - particularly for more basic models. However, one cannot run person-centred dimension reduction (or mixture modelling) in lavaan - one would have to move to MPlus for this (or look around for other packages!)

If you are working mostly in R anyway, I would typically suggest lavaan over MPlus. For people more familiar with coding especially, lavaan is typically much more intuitive.

Please check out the following pages for tutorials and other helpful information on using lavaan :

The package itself + some of the basic capabilities:

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

https://m-clark.github.io/docs/FA_notes.html

https://m-clark.github.io/docs/lv_sim.html

Running mediation:

https://ademos.people.uic.edu/Chapter15.html

Group comparisons:

https://m-clark.github.io/posts/2019-08-05-comparing-latent-variables/

Sensitivity analyses:

https://github.com/sfcheung/semfindr

https://cran.r-project.org/web/packages/SEMsens/vignettes/SEMsens.html

Other helpful packages (e.g. for using multiple imputed datasets, probing at levels of a moderator, rerunning with confidence intervals, etc)

https://cran.r-project.org/web/packages/semTools/index.html

https://github.com/TDJorgensen/lavaan.mi

https://sfcheung.github.io/manymome/

https://sfcheung.github.io/semlbci/

https://sfcheung.github.io/semhelpinghands/

https://sfcheung.github.io/semptools/

https://sfcheung.github.io/stdmod/

Bayesian lavaan:

https://github.com/TDJorgensen/blavaan

Clone this wiki locally