SEM in R Flashcards
latent variable
=~
regression
~
(residual) variance
~~
intercept
~ 1
Fix all variances of latent variables to unity
fit <- cfa(HS.model,
data = HolzingerSwineford1939,
std.lv = TRUE)
constraining parameter…
worsens model fit
freeing parameter…
improves model fit
fix loading multiple group
c(0.6, 0.8)*x3
fix parameter in some, not all
c(a, b, NA, c)*x3
weak invariance
group.equal = c(“loadings”))
strong invariance
group.equal = c(“loadings”, “intercepts))
strict invariance
group.equal = c(“loadings”, “intercepts”, “residuals”, “residual.covariances”))
LGC manual
model2 <- ‘
int =~ 1bmi1 + 1bmi2 + 1bmi3 + 1bmi4 + 1bmi5
slp =~ 0bmi1 + 1bmi2 + 2bmi3 + 3bmi4 + 4bmi5 + 5bmi6
# Latent variances and covariances:
int ~~ int
slp ~~ slp
int ~~ slp
bmi1 ~~ bmi1
bmi2 ~~ bmi2
bmi3 ~~ bmi3
bmi4 ~~ bmi4
bmi5 ~~ bmi5
bmi6 ~~ bmi6
int ~ 1
slp ~ 1
bmi1 ~ 01
bmi2 ~ 01
bmi3 ~ 01
bmi4 ~ 01
bmi5 ~ 01
bmi6 ~ 01
‘
orthogonal variance
x ~~ 0*y
Fix variance
x ~~ 1*x