Model Specification

Structural Equation Modeling with lavaan in R

Erin Buchanan

Professor

SEM Goals

  • Explore the relationship between variables
  • Confirm the structure of a developed model

Example SEM Model of IQ Predicting Academic Scores

Structural Equation Modeling with lavaan in R

Variables

  • Manifest variables:
    • Real numbers in your dataset
    • Represented by squares

Manifest Variable Squares

  • Latent variables:
    • Phenomenon measured by manifest variables
    • Represented by circles

Latent Variable Circle

Structural Equation Modeling with lavaan in R

Example Model

Example SEM Model of IQ Predicting Academic Scores

Structural Equation Modeling with lavaan in R

Set Up Your Model

library(lavaan)
data(HolzingerSwineford1939)
head(HolzingerSwineford1939[7:15])
        x1   x2    x3       x4   x5        x6       x7   x8       x9
1 3.333333 7.75 0.375 2.333333 5.75 1.2857143 3.391304 5.75 6.361111
2 5.333333 5.25 2.125 1.666667 3.00 1.2857143 3.782609 6.25 7.916667
3 4.500000 5.25 1.875 1.000000 1.75 0.4285714 3.260870 3.90 4.416667
4 5.333333 7.75 3.000 2.666667 4.50 2.4285714 3.000000 5.30 4.861111
5 4.833333 4.75 0.875 2.666667 4.00 2.5714286 3.695652 6.30 5.916667
6 5.333333 5.00 2.250 1.000000 3.00 0.8571429 4.347826 6.65 7.500000
Structural Equation Modeling with lavaan in R

Set Up Your Model (2)

#an example
model <- 'latent_variable =~ manifest_variable1 + ...'
#our model
visual.model <- 'visual =~ x1 + x2 + x3 + x7 + x8 + x9'
Structural Equation Modeling with lavaan in R

Let's practice!

Structural Equation Modeling with lavaan in R

Preparing Video For Download...