Last updated 2023-06-03.
This Github repo contains all lesson files for SEM - Practical
Applications in R. The goal is to impart students with the basic tools
to construct, evaluate and compare Structural Equation Models (SEM; w/
plots), using lavaan.
These topics were taught in the graduate-level course Structural Equation Modeling (Psych Dep., Ben-Gurion University of the Negev). This course assumes basic competence in R (importing, regression modeling, plotting, etc.), along the lines of Practical Applications in R for Psychologists.
Notes:
- This repo contains only materials relating to Practical Applications in R, and does not contain any theoretical or introductory materials.
- Please note that some code does not work on purpose, to force students to learn to debug.
You will need:
- A fresh installation of
R(preferably version 4.0 or above). - RStudio IDE (optional, but recommended).
- The following packages, listed by lesson:
You can install all the packages used by running:
# in alphabetical order:
pkgs <-
c(
"bayestestR", "car", "dplyr", "factoextra", "ggplot2", "GPArotation",
"lavaan", "magrittr", "MVN", "nFactors", "parameters", "patchwork",
"performance", "psych", "psychTools", "recipes", "semTools",
"tidySEM", "tidyverse"
)
install.packages(pkgs, dependencies = TRUE)
Package Versions
The package versions used here:
bayestestR0.13.1 (CRAN)car3.1-2 (CRAN)dplyr1.1.1 (CRAN)factoextra1.0.7 (CRAN)ggplot23.4.2 (CRAN)GPArotation2023.3-1 (CRAN)lavaan0.6-15 (CRAN)magrittr2.0.3 (CRAN)MVN5.9 (CRAN)nFactors2.4.1.1 (CRAN)parameters0.21.0 (CRAN)patchwork1.1.2 (CRAN)performance0.10.3 (CRAN)psych2.3.3 (CRAN)psychTools2.3.3 (CRAN)recipes1.0.5 (CRAN)semTools0.5-6.917 (Dev)tidySEM0.2.3 (CRAN)tidyverse2.0.0 (CRAN)
In addition to lavaan’s
toutorials, you might find
the following online courses useful:
- Sacha Epskamp’s online course and
YouTube
lectures.
- See also the
psychonetricspackage for psychometric network modeling.
- See also the
- Michael Hallquist’s course.
These are selected episodes from the Quantitude podcast related to SEM:
