model <- '
# latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem60 ~ ind60 dem65 ~ ind60 + dem60
# residual covariances
y1 ~~ y5 y2 ~~ y4 + y6 y3 ~~ y7 y4 ~~ y8 y6 ~~ y8 '
fit <- sem(model, data=PoliticalDemocracy)
summary(fit)
Is there a way to retrieve the syntax, including the latent variable definitions, regressions, and residuals, as an intact object that I can reuse it in subsequent models? Thanks in advance.
Joe
Have you looked at
For model syntax, can't you just use the model object you
previously defined?
You likely just need to write your own function to extract the
specific pieces you're interested in and combine them in the
format you want. Shouldn't be too hard.
Chris
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.