Summarize the Multi-Factor Model
You have now created a two-factor model of the reading comprehension and speeded addition factors. Is that better than a one-factor model? Use the cfa()
and summary()
functions on your new two-factor model of the HolzingerSwineford1939
dataset to show the fit indices.
This exercise is part of the course
Structural Equation Modeling with lavaan in R
Exercise instructions
- Save your model fit as
twofactor.fit
using thecfa()
function. - Use the
summary()
function to view the fitted model. - Compare the fit indices from the one-factor model to the updated model.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Previous one-factor model output
summary(text.fit, standardized = TRUE, fit.measures = TRUE)
# Two-factor model specification
twofactor.model <- 'text =~ x4 + x5 + x6
speed =~ x7 + x8 + x9'
# Use cfa() to analyze the model and include data argument
# Use summary() to view the fitted model