Hi there, welcome. This website supplies the supplementary materials for the structural equation modeling(SEM) courses taught by Dr. Gregory R. Hancock. Dr. Hancock teaches winter short courses on SEM as well as EDMS722 Structural Equation Modeling at University of Maryland, College Park.
In class, you have already gained a good knowledge about how to use
Mplus with a variety
of models. Here we are going to introduce you to another useful tool
that can be used to conduct latent variable analysis: lavvan
.
lavaan
is a free open-source package in R that is
developed for latent variable modeling. lavaan
is a
powerful tool that can accomodate most of the models you have learned in
this course. The authors of lavaan
package has developed a
series of tutorials for
lavaan
users. We would recommend you to go over their
tutorials if you are new to lavaan
. After all, the
developers have the best knowledge of their software package.
The tutorials we supply here are all based on the examples and
exercises you have already seen in class, where you have practiced with
Mplus. We will walk you through these examples using lavaan
in our tutorials. Both Mplus and lavaan
are great tools for
SEM. We provide the lavaan
tutorials here with the hope to
help you better learn about SEM in this course. First, with the tutorial
materials available, you can better focus on the more important contents
when you are in the class. It can be frustrating and distracting when
you want to focus on the lectures while R is yelling at you with some
error message. We want to take that burden off you so you can enjoy your
class time better. Actually, once you have had a solid grasp on the
mechanisms of SEM, it will not be too difficult to translate your
knowledge to a software language (Mplus, lavaan, LISREL, OpenMx,
STATA…). Providing the lavaan
materials here, in addition
to the Mplus materials you have learned in class, we wish to add to your
toolkit by showing you how to use lavaan
, such that you
will have an additional (free) tool at your disposal when you need to
employ SEM in your own research projects.
To get you started:
Before we get started, please make sure you have installed R or
RStuido, as well as the lavaan
package on your device.
install.packages("lavaan", dependencies=TRUE)
library(lavaan)
Important
Please make sure you have correctly set up your working directory to where your data are stored. To see your current working directory:
getwd()
To change your working directory, you can either use the
setwd()
function, or click the “Session –> Set Working
Directory” button in the menu.
mypath <- "/SEM Second Course Mplus 2019/Advanced Examples/5. Growth Examples"
setwd(mypath)
In-class Examples
Hands-on Exercises
If you only have access to the Mplus Demo version and you are seeking for parallel R code for the corresponding exercises, please refer to “Exercise Solutions-DEMO”.