(Sorry, I posted this once and noticed a few typos - going to try this again)
Here is the model so far, and I'm wondering how to include the residual structure. Are "phantom variables," as seen in Curran's example input (attached), needed?:
modelaltxy <- '
# growth curve rail
i =~ rail1 + 1*rail2 + 1*rail3 + 1*rail4
i ~ 1; i ~~ i
s= ~ rail1 + 1*rail2 + 2*rail3 + 3*rail4
s ~ 1; s ~~ s
rail1 ~~ rail1
rail2 ~~ rail2
rail3 ~~ rail3
rail4 ~~ rail4
# autoregressive components rail
rail2 ~ a1*rail1
rail3 ~ a2*rail2
rail4 ~ a3*rail3
# growth curve dep
i2 =~ dep1 + 1*dep2 + 1*dep3 + 1*dep4
i2 ~ 1; i2 ~~ i2
s2= ~ dep1 + 1*dep2 + 2*dep3 + 3*dep4
s2 ~ 1; s2 ~~ s2
dep1 ~~ dep1
dep2 ~~ dep2
dep3 ~~ dep3
dep4 ~~ dep4
# autoregressive components dep
dep2 ~ b1*dep1
dep3 ~ b2*dep2
dep4 ~ b3*dep3
# cross-lagged components
dep3 ~ rail2
dep4 ~ rail3
rail3 ~ dep2
rail4 ~ dep3
'
fit.altxy <- lavaan(modelaltxy, sample.cov = COV, sample.mean = MEANS,
sample.nobs = 180, mimic = "EQS", missing = "fiml")
summary(fit.altxy)
Also, thank you for the translation - Curran's Mplus code seems slightly less foreign now. Speaking of which, I have attached here his demo data and Mplus input example. After loading lavaan and setting my working directory to where these two Curran files are located, here is what I'm attempting to run for the mplus2lavaan() function:
out <- mplus2lavaan("M06.inp")
summary(out$lav.out)
Seems like it should be easy enough, but I receive this error:
Read 80 items
Error in parse(text = x, keep.source = FALSE) :
<text>:2:0: unexpected end of input
1: ~
^
Thank you again for any help,
Kaylin