Hello!
I'm doing a simulation study where I've generated data so that the control group has a linear growth trajectory and the treatment group has quadratic trajectory. I wanted to attempt to replicate an analysis in Muthen and Curran 1997 (figure 5 - see attached). In this analysis, there are two groups where the intercept and the first slope factor are constrained to be equal and there is an added slope factor that is only in the treatment group. My attempts at coding this model don't seem to be correct. Below is what I currently have:
addg_mod <- "
i =~ 1*y1 + 1*y2 + 1*y3 + 1*y4 + 1*y5 + 1*y6
s1 =~ 0*y1 + 1*y2 + 2*y3 + 3*y4 + 4*y5 + 5*y6
s2 =~ 0*y1 + 1*y2 + 4*y3 + 9*y4 + 16*y5 + 25*y6
i ~~ s1
i ~~ s2
i ~ c(a1, a1)*1
s1 ~ c(b1, b1)*1
"
addg_fit <- growth(addg_mod, data = allg, group = 'x')
For the model to work properly, you must constrain the intercept and the first slope factor to be equal which is what I believe I've done on in the last two lines of my model syntax. Unfortunately, when I look at my output it appears that i and s1 are constrained across groups, but I do not receive an estimate for s2 in either group. I'm not sure how to indicate that I want s2 to be only for my treatment group. I am also getting warnings for negative variances. I was wondering if constraining my variances to be equal across groups would resolve this issue?
My main questions are:
1) How do I adjust my syntax so that I receive an estimate for s2 and that s2 estimate is only for the treatment group?
2) If necessary, how I do avoid negative variances by constraining the variances to be equal across groups?
Any help would be appreciated and please let me know if I can provide further clarification.