Hi everyone,
I am trying to run a latent growth model using data from three time-points. However, I also have three different groups (1 control and 2 experimental).
I've seen it is possible to do a multi group analysis with lavaan, however, when I try to do this with my code I seem to get an error message
I use the following code:
model <- 'i =~ 1*Food_waste + 1*Food_waste_2 + 1*Food_waste_3
s =~ 0*Food_waste + 1*Food_waste_2 + 2*Food_waste_3'
fit1 <- growth(model, data = data, missing='fiml', group = Condition)
I get this message: Error in lavaan::lavaan(model = model, data = data, group = Condition, :
object 'Condition' not found
If I use an identical code but just have condition in quotation marks (group = "Condition") I get another error message: Error in `vec_equal()`:
! Can't combine `..1` <character> and `..2` <double>.
I would be very grateful for any tips or advice on how to resolve this!
Thank you so much!
Best
Kaloyan