# Adapted from https://lavaan.ugent.be/tutorial/cfa.html
library(lavaan)
HS.model <- '
visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
'
fit_cfa <- cfa(HS.model,
data = HolzingerSwineford1939)
annotate_matrices(fit_cfa)
Run the code above in your browser using DataLab