Last updated 2020-10-30.
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, Spring, 2019). 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 3.6 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", "ggplot2", "lavaan", "nFactors",
"parameters", "psych", "psychTools", "semPlot", "semTools", "tidyr",
"tidySEM"
)
install.packages(pkgs, dependencies = TRUE)
Package Versions
The package versions used here:bayestestR
0.7.5 (CRAN)car
3.0-10 (CRAN)dplyr
1.0.2 (CRAN)ggplot2
3.3.2 (CRAN)lavaan
0.6-7 (CRAN)nFactors
2.4.1 (CRAN)parameters
0.9.0 (CRAN)psych
2.0.9 (CRAN)psychTools
2.0.8 (CRAN)semPlot
1.1.2 (CRAN)semTools
0.5-3 (CRAN)tidyr
1.1.2 (CRAN)tidySEM
0.1.3 (CRAN)
lavaan
toutorials.- Sacha Epskamp’s online course and YouTube lectures.
- Michael Hallquist’s course.