Abstract: Lavaan is a free package in R used for performing structural equation modelling. Its intuitive and flexible syntax makes it a great option for estimating simple and complex models. The training will provide a hands-on introduction to lavaan. It will cover (a) preparing data, (b) specifying and estimating models, (c) modification indices, (d) model comparison, and (e) extracting parameters and fit statistics. The main focus will be on fitting confirmatory factor analytic models to multiple item psychological questionnaires. Lecture-style presentation will be combined with practical exercises. On successful completion of the training, participants should be able to perform confirmatory factor analysis on their own data. Prior experience using R will be helpful but is not essential. Participants should bring a laptop. Participants will be emailed prior to the workshop with instructions about installing R, RStudio, and lavaan.
Download and install R and Rstudio
Then, in R, install the following packages.
install.packages("lavaan")
install.packages("psych")
install.packages("ProjectTemplate")
Download the files for the workshop:
- Click the link "clone or download"
- Download ZIP
- Unzip on your desktop
I will go through the files in the workshop.
The best way to open the files is to:
- Open "lavaan-example.Rproj", which will open the project in RStudio.
- Open "0-lavaan-tutorial.rmd" or "1-cfa-exercise.rmd" (these files contain the main exercises).