Dear Community,
Lavaan newbie here. I've been trying to specify a latent growth curve model as per attached path diagram in R for a few days now. The theoretical path is reasonably clear to me, however I am failing to translate my theoretical ideas (as in the path diagram) into a working lavaan code.
I would like to build such a model for each of a total of 15 personality traits. Each personality trait was collected at three measurement times with 4 items each. Also, I would like to add age and gender as covariates, stepwise I would also like to add age^2 and age^3 to see if these effects are more fitting.
Attached is my path diagram for an exemplary personality trait.
This is what my code (exemplary for one personality trait) looks like so far, but unfortunately I get very poor fits, sometimes even negative degrees of freedom.
lgcmAengst <- '
i =~ 1*T1NeuroAengstlichkeitMean + 1*T2NeuroAengstlichkeitMean + 1*T3NeuroAengstlichkeitMean
s =~ 0*T1NeuroAengstlichkeitMean + 1*T2NeuroAengstlichkeitMean + 2*T3NeuroAengstlichkeitMean
i ~ SQ1_age + SQ1_sex
s ~ SQ1_age + SQ1_sex
'
lgcmAengstfit <- growth(lgcmAengst, data = daten)
summary(lgcmAengstfit, fit.measures=TRUE)
Does anyone have any ideas where errors could be?
Thanks so much in advance.
Thorben
PS: TXNeuroAengstlichkeitMean is the mean value out of the 4 items that have been collected at the measurement point for this trait.