LavaanM <- '
# Measurement model (fixed factor loading)
F1 =~ 0.7*x1 + 0.7*x2 + 0.7*x3
F2 =~ 0.7*x4 + 0.7*x5 + 0.7*x6
F3 =~ 0.7*x7 + 0.7*x8 + 0.7*x9
# Structural regressions
F2 ~ 0.4*F1
F3 ~ 0.6*F1
# Fix latent variances
F1 ~~ 1*F1
# Residual variances
F2 ~~ 1*F2
F3 ~~ 1*F3
# Correlated residuals
F2 ~~ 0.5*F3
'
cov.mtx(Model=LavaanM, nobs=9)
Run the code above in your browser using DataLab