Dear Lavaan community,
I am working on building a latent growth curve model of depressive symptoms (continuous) across 4 time points (unequal spacing) during adolescence. I am testing a no-growth model, a linear model, and a quadratic model. The quadratic model had the best fit. I then needed to add multiple time-invariant and time-varying covariates to the model.
When I ran the model without covariates, the results made sense base on previous research and the means in my dataset (i.e., linear slope is significant and positive, quadratic slope is significant and negative). However, when I added the covariates, although I am getting fine fit indices, the results don't make sense anymore, both slopes are not significant and their signs are opposite. This lead me to think that perhaps the way I am specifying my model is incorrect (see syntax below).
mod6<-'
# factor loadings
mfq_i=~ 1*mfq10 + 1*mfq16 + 1*mfq17 + 1*mfq23
mfq_s=~ 0*mfq10 + 0.603*mfq16 + 0.719*mfq17 + 1.224*mfq23
mfq_q=~ 0*mfq10 + 3.636*mfq16 + 5.170*mfq17 + 14.982*mfq23
# time-invariant covariates
mfq_i~sex+spar+educ2
mfq_s~sex+spar+educ2+tannerph
mfq_q~sex+spar+educ2+tannerph
# time-varying covariates
mfq10~fmi9+crp9+meds9
mfq16~fmi15+crp15+meds15+ageq16+oc15+smok15+drink15
mfq17~fmi17+crp17+meds17+ageq17+oc17+smok17+drink17
mfq23~fmi24+crp24+meds24+ageq23+smok24+drink24
'
fit6<-growth(mod6,data=mydata, estimator='MLR', missing="FIML.x")
summary(fit6, fit.measures=TRUE, standardized=TRUE)
In this syntax I am using the growth() function and I followed the syntax from the lavaan tutorial. I noticed that using this function, it sets the means of the manifest variables to zero, but freely estimates their variance. It is also giving the covariance between the factors.
However, for the covariates, it only estimates their regressions with the factors, and does not estimate their means, variance, nor covariance between covariates. Is that a proper way to run a LGCM with covariates? Should I add these components to my model, and if this is the case, would I need to change anything in the final fit line?
I also found separate syntax from Pennstate quantdev tutorials that I tried to follow: one for including time-invariant and one for time-varying covariate (showing an example when only one covariate is included), so I am not sure exactly how to combine those and I have several critical questions.
In their example when they were using the sem() function, they set the factor means to be zero, but then also set the manifest variance to be equal, which is different than what the growth function does. Which one is the appropriate way to do?
For time invariant covariates, they included covariance between the two covariates, and freely estimated their means and variance.
However for the time-varying covariate example, they are freely estimating the means but they are imposing equality constraints on both their variance and their regressions with the factors. What is the purpose of adding these equality constraints? Is this really accounting for the effects of the time-varying covariates in the different waves if making them equal? They also did not include covariance between the covariates, but they are likely correlated... Is this step unnecessary if imposing equality constraints? This is confusing to me because they did estimated covariance between two time-invariant covariates in the other syntax.
When I tried to build my models in the sem function based on these scripts I am getting awful fit indices, and I am also getting warning messages that the cov matrix is not positive definitive and that some lv variance is negative. I am not sure if this is because I am setting up my model incorrectly or if this is related to some of my variables, but I want to make sure first that I am setting up my model properly.
I would highly appreciate any input you may have. I am including the links for the tutorials I was referring to.
Thank you so much!
May
Links:
when I added the covariates, although I am getting fine fit indices, the results don't make sense anymore, both slopes are not significant and their signs are opposite.
In this syntax I am using the growth() function and I followed the syntax from the lavaan tutorial. I noticed that using this function, it sets the means of the manifest variables to zero
However, for the covariates, it only estimates their regressions with the factors, and does not estimate their means, variance, nor covariance between covariates.
I also found separate syntax from Pennstate quantdev tutorials ... when they were using the sem() function, they set the factor means to be zero, but then also set the manifest variance to be equal, which is different than what the growth function does. Which one is the appropriate way to do?
For time invariant covariates, they included covariance between the two covariates, and freely estimated their means and variance.
However for the time-varying covariate example, they are freely estimating the means but they are imposing equality constraints on both their variance and their regressions with the factors. What is the purpose of adding these equality constraints?
When I tried to build my models in the sem function based on these scripts I am getting awful fit indices, and I am also getting warning messages that the cov matrix is not positive definitive and that some lv variance is negative. I am not sure if this is because I am setting up my model incorrectly or if this is related to some of my variables, but I want to make sure first that I am setting up my model properly.