Structural Equation Modeling foR Psychologists
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.
Setup
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:
bayestestR
0.13.1 (CRAN)car
3.1-2 (CRAN)dplyr
1.1.1 (CRAN)factoextra
1.0.7 (CRAN)ggplot2
3.4.2 (CRAN)GPArotation
2023.3-1 (CRAN)lavaan
0.6-15 (CRAN)magrittr
2.0.3 (CRAN)MVN
5.9 (CRAN)nFactors
2.4.1.1 (CRAN)parameters
0.21.0 (CRAN)patchwork
1.1.2 (CRAN)performance
0.10.3 (CRAN)psych
2.3.3 (CRAN)psychTools
2.3.3 (CRAN)recipes
1.0.5 (CRAN)semTools
0.5-6.917 (Dev)tidySEM
0.2.3 (CRAN)tidyverse
2.0.0 (CRAN)
Other Useful Resources
Other Courses
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
psychonetrics
package for psychometric network modeling.
- See also the
- Michael Hallquist’s course.
Selected Quantitude (podcast) Episods
These are selected episodes from the Quantitude podcast related to SEM: