Estimator = WLSMV

326 views
Skip to first unread message

Jonil Ursin

unread,
Nov 7, 2022, 8:02:16 AM11/7/22
to lavaan
Hi 

I'm trying to do a CFA on a dataset with ordinal variables (response categories 1-4) and as  I understand WLSMV is a better estimator to use when dealing with this kind of data. 

However, I'm wondering what the correct syntax would be. 
From the lavaan tutorial  it seems like you can write ordered=TRUE to specify that all variables are to be treated as categorical, and by doing so lavaan automatically switches to the WLSMV estimator. Giving me the following syntax

fit1. <- cfa(myModel, data = mydata, ordered=TRUE)

But it seems like you can also write the syntax where you sepcify which estimator you want it to use, like this:

fit2. <- cfa(myModel, data=mydata, estimator ="WLSMV")

I would then think these two would give me the same results, but they don't... Why? And what is the correct way to get the program to use the WLSMV estimator for the factor analysis? 

Would it be correct to write it like this:

fit <- cfa(MyModel, data=mydata, estimator="WLSMV", ordered=TRUE)


Many thanks, 

Jonil 

Bojana Dinić

unread,
Nov 7, 2022, 8:44:40 AM11/7/22
to lav...@googlegroups.com
Hi Jonil,

ordered=TRUE should be included in syntax in this case.

Kind regards,
Bojana

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/a1add02d-b3a9-48af-9e4d-6c8b83850dd2n%40googlegroups.com.

Jonil Ursin

unread,
Nov 7, 2022, 10:29:20 AM11/7/22
to lavaan
Thanks :) So the correct syntax would include both estimator=WLSMV and ordered=TRUE? 

Terrence Jorgensen

unread,
Nov 7, 2022, 10:59:05 AM11/7/22
to lavaan
So the correct syntax would include both estimator=WLSMV and ordered=TRUE? 

Declaring even a single ordered variable changes the default estimator to WLSMV, so the estimator= argument is not necessary on top of ordered= unless you want to change the default (e.g., estimator = "PML")

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

Reply all
Reply to author
Forward
0 new messages