lavaan – a user-friendly SEM package for R
Remember when we pondered about an Mplus-style interface for SEM packages in R? Turns out that Yves Rosseel not only had the same idea, but did actually implement such a package first on top of the sem-package and finally as a standalone library. Lavaan is still in beta but offers a very simple syntax similar to Mplus and most of the features you might need in your daily SEM practice, including multiple estimators, FIML for missing data, multiple group comparisons and longitudinal modeling. It does not have all the cutting edge features of Mplus and its add-ons but is extremely user-friendly.
Especially notable is the super-simple implementation of multi-group and invariance testing which is way better than in Mplus and even easier than the wizard-thing in AMOS. Since measurement equivalence seems to be a hot topic nowadays in many social science applications, Yves’ ideas and implementation are very timely and useful. I am pretty sure we will add lavaan as a third option for our beginners and longitudinal workshops in the coming season (workshops are on hiatus until Jens and I have finished our PhD theses, by the way).
I have only run a few models yet but it seems like Lavaan is easier to use while OpenMX seems to support more advanced modeling, especially if you want to customize your SEM models or run simulations. Choice is good and both package will have a strong impact on the commercial offerings that have dominated the SEM market for a long time.
Thanks, Yves, for a great package, and kudos to Alexander Robitzsch for sending us the link!
4 Responses to “lavaan – a user-friendly SEM package for R”
Leave a Reply

Jens Vogelgesang on May 28th, 2010
Yeah, I totally agree with Michael! Now the question is, how long will it take to implement WLSMV?
rabil on August 4th, 2010
I had the pleasure of meeting Yves at the recent useR! 2010 conference. I hadn’t heard of lavaan until the conference and I’m looking forward to trying it. I’m using OpenMx but it was pointed out to me that OpenMx is not completely open as the optimization is closed source. (At least that is my understanding – please correct me if I’m wrong.) I’m applying SEM to relatively simple measurement error models in methods comparison studies where researchers have “hard” data. (It’s surprising just how “soft” data from complex instruments can be!) What I need from a SEM package is the ability to compute functions of the model parameters and corresponding confidence intervals. Mx can do this (but is really tedious to use and the matrix naming is extremely limited). OpenMx either has this now or will soon (I’ve had problems with this feature using OpenMx but it may have to do with the relatively small sample sizes I encounter.) I hope these features will eventually be included in lavaan (along with the ability to handle dichotomous and ordinal data).
Faan Louw on September 21st, 2010
Hi,
Lavaan is fantastic in its simplicity. However, how do I draw a digraph of the estimated model? This is a procedure which I could not find.
Good work Yves.
Kees-Jan Kan on January 4th, 2012
@ Faan
Perhaps you find the qgraph package useful: http://cran.r-project.org/web/packages/qgraph/qgraph.pdf
It contains the function qgraph.lavaan
Kind regards,
Kees-Jan