Fitting growth curve model with ordinal indicators and imputed data

61 views
Skip to first unread message

Matti Cervin

unread,
Apr 5, 2019, 11:53:40 AM4/5/19
to lavaan
Hi all,

After some help here, I am working on fitting a growth curve model with ordinal indicators, but I can't get the syntax right. Below is a straightforward code that do not work. I impute data with mice and the use the list of imputed data sets as the input for lavaan. The ordinal indicators are x1-x4 and y1-y4 in this example.


imp<-mice(data, m=5, maxit=10, seed=1234)

milist <- miceadds::mids2datlist(imp)

model<-'
i1 =~ 1*x1 + 1*x2 + 1*x3 + 1*x4
i2 =~ 1*y1 + 1*y2 + 1*y3 + 1*y4

s1 =~ 0*x1 + 1*x2 + 2*x3 + 3*x4
s2 =~ 0*y1 + 1*y2 + 2*y3 + 3*y4'

fit<-runMI(model, milist, 
           estimator="WLSMV", 
           fun="growth", 
           ordered=c("x1","x2","x3","x4",
                     "y1","y2","y3", "y4"))


Anyone that knows how to fit a growth curve model with ordinal indicators? I would be very thankful for help with specifying the model!

Best wishes,
Matti

Terrence Jorgensen

unread,
Apr 6, 2019, 4:26:07 PM4/6/19
to lavaan
Anyone that knows how to fit a growth curve model with ordinal indicators? 

As described in the article I posted on the other thread, you need to fix your thresholds in order to "squeeze interval information" from them.

x1 | 0*t1
...
y4
| 0*t1


And because you have no observed means, you must fix the mean of the latent intercepts to 0 for identification.

i1 ~ 0*1
i2
~ 0*1


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Matti Cervin

unread,
Apr 7, 2019, 5:01:19 PM4/7/19
to lav...@googlegroups.com
Thank you Terrence! I followed your instructions using this code:

model<-'
ifreq =~ 1*freq1 + 1*freq2 + 1*freq3 + 1*freq4
ipsy =~ 1*psy1 + 1*psy2 + 1*psy3 + 1*psy4

sfreq =~ 0*freq1 + 1*freq2 + 2*freq3 + 3*freq4
spsy =~ 0*psy1 + 1*psy2 + 2*psy3 + 3*psy4

ifreq ~ 0*1
ipsy ~ 0*1

freq1 | 0*t1
freq2 | 0*t1
freq3 | 0*t1
freq4 | 0*t1

psy1 | 0*t1
psy2 | 0*t1
psy3 | 0*t1
psy4 | 0*t1
'

fit<-runMI(model, milist, 
            estimator="WLSMV", fun="growth", 
            ordered=c("freq1", "freq2", "freq3", "freq4",
                      "psy1", "psy2", "psy3", "psy4"))

However, this error code appeared:

Error in lav_partable_flat(FLAT, blocks = "group", meanstructure = meanstructure,  : 
  lavaan ERROR: expected 4 threshold(s) for variable ‘freq1’; syntax contains 1

Any suggestions on how to proceed/fix the code?

Thanks!

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/g-rV-D4LmV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Terrence Jorgensen

unread,
Apr 8, 2019, 7:23:53 AM4/8/19
to lavaan
However, this error code appeared:

Error in lav_partable_flat(FLAT, blocks = "group", meanstructure = meanstructure,  : 
  lavaan ERROR: expected 4 threshold(s) for variable ‘freq1’; syntax contains 1

Any suggestions on how to proceed/fix the code?

Have you read the paper yet?  freq1 clearly has 5 categories, so you need to fix 4 thresholds to some kind of meaningful values, as the paper shows.

freq1 | 0*t1 + 1*t2 + 2*t3 + 3*t4


Matti Cervin

unread,
Apr 8, 2019, 1:50:49 PM4/8/19
to lav...@googlegroups.com
Thank you, Terrence. No, I have not read through the whole paper yet. I struggle with the math formulae so it will take me a while, but I will get through it.

--
Reply all
Reply to author
Forward
0 new messages