knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options(scipen = 999)
knitr::opts_chunk$set(echo = TRUE)
library(lavaan, quietly = T)
library(semPlot, quietly = T)
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '

fit <- cfa(HS.model, data = HolzingerSwineford1939)

HS.model2 <- 'visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 
              visual ~ speed'
fit2 <- cfa(HS.model2, data = HolzingerSwineford1939)

HS.model3 <- 'visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 
              visual ~ speed
              speed ~ textual
              textual ~ visual'
fit3 <- cfa(HS.model3, data = HolzingerSwineford1939)

Structural Equation Modeling

Structural Equation Modeling

Concepts

Concepts

Concepts

knitr::include_graphics("pictures/exo_endo.png")

Concepts

knitr::include_graphics("pictures/exo_endo.png")

Concepts

Concepts

semPaths(fit,
         whatLabels = "std",
         edge.label.cex = 1)

Concepts

semPaths(fit2,
         whatLabels = "std",
         edge.label.cex = 1)

Concepts

knitr::include_graphics("pictures/full_sem.png")

Concepts

semPaths(fit2,
         whatLabels = "std",
         edge.label.cex = 1)

Concepts

semPaths(fit3,
         whatLabels = "std", 
         edge.label.cex = 1)

Interpreting a SEM Diagram

Parameters

Unstandardized estimates

Parameters

summary(fit2)

Parameters

Standardized estimates: note there are several ways to "standardize" the solution, we will cover this more later

Parameters

summary(fit2, standardized = T, rsquare = T)

Types of Research Questions

Types of Research Questions

Practical Issues

Practical Issues

Hypothesis Testing

Hypothesis Testing

Approaches to Modeling

Approaches to Modeling

knitr::include_graphics("pictures/model_steps.png")

Specification

Identification

Identification

Identification

Identification

Identifying What's What

semPaths(fit)

Identifying What's What

Identifying What's What

summary(fit)

Identification

Identification

Identification

Identification

Identification

summary(fit, standardized = T)

Identification

Positive Definite Matrices

Positive Definite Matrices

Summary

In this lecture you've learned:



doomlab/learnSEM documentation built on Jan. 25, 2024, 2 p.m.