#============================================================================
# Example is taken from the lavaan website
#============================================================================
# Note: example is modified. Across-block correlations are removed
model <- "
# Measurement model
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# Regressions / Path model
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y2 ~~ y4
y6 ~~ y8
"
aa <- csem(PoliticalDemocracy, model)
Run the code above in your browser using DataLab