Determining Group Order in Multi-Group Analysis

336 views
Skip to first unread message

Garett Howardson

unread,
Nov 15, 2013, 12:38:56 PM11/15/13
to lav...@googlegroups.com
Can anyone point me to some documentation on how lavaan determines the order of groups in a multiple group factor analysis? I'm conducting a measurement equivalence test and I want to force one specific group to be the referent by having a latent mean of zero. By default, lavaan forces the "first" group's latent mean to be zero, but can anyone tell how it determines what the "first" group is? My grouping variable is of type integer so I thought perhaps it would keep the order the same as in the data, 1, 2, 3. However, I wanted to make sure that the mean for group 3 was fixed to zero while the other two were estimated, so I used the syntax I found in an earlier thread:
 
f1~c(m1, m2, m0)*1 + c(NA, NA, 0)*1.
 
Looking at the output, this did indeed fix the third group's latent mean to be zero. However, lavaan ordered the groups as 3, 1, 2, which resulted in the mean being fixed to zero for group 2 rather than 3.
 
I thought perhaps the order was a function of group size, but my Ns are 7043 (group 3), 1843 (group 1), and 3028 (group 2) so it's not ordering them by sample size. I know that I can just remove the labels for the current analysis and lavaan will fix the latent mean for the correct first group (group 3) to zero, but going forward I'd like to be able to know how the order is determined apriori so I can make sure I'm fixing the correct parameters in my syntax.
 
Thank you.

yrosseel

unread,
Nov 15, 2013, 1:30:16 PM11/15/13
to lav...@googlegroups.com
On 11/15/2013 06:38 PM, Garett Howardson wrote:
> Can anyone point me to some documentation on how lavaan determines the
> order of groups in a multiple group factor analysis?

See ?cfa and look for the group.label argument:


group.label: A character vector. The user can specify which group (or
factor) levels need to be selected from the grouping
variable, and in which order. If �NULL� (the default), all
grouping levels are selected, in the order as they appear in
the data.


Yves.

Garett Howardson

unread,
Nov 15, 2013, 1:48:03 PM11/15/13
to lav...@googlegroups.com
Thank you Yves. I apologize for not looking at the documentation first. 

Garett

Amanda Pollitt

unread,
Oct 20, 2014, 3:16:17 PM10/20/14
to lav...@googlegroups.com
Sorry to revive an old thread, but does "all grouping levels are selected, in the order as they appear in the data" mean that the groups match the actual order of values (1, 2, 3, 4) or of which value appears first in the data? Because I've had more than one frustrating time of finding out that the group order in the output is very different than the true order. For example, my most recent analyses have an order of 2, 3, 1, 4. I also just double checked and the data are sorted on my group variable (1, 2, 3, 4). Is this a bug?

yrosseel

unread,
Oct 21, 2014, 2:22:57 AM10/21/14
to lav...@googlegroups.com
On 10/20/2014 09:16 PM, Amanda Pollitt wrote:
> Sorry to revive an old thread, but does "all grouping levels are
> selected, in the order as they appear in the data" mean that the groups
> match the actual order of values (1, 2, 3, 4) or of which value appears
> first in the data?

The data determines the order, not the output of levels().

> Because I've had more than one frustrating time of
> finding out that the group order in the output is very different than
> the true order

What is the 'true' order? The output of the levels(). That will give you
alphabetic order.

Note that you can you the group.label= argument to specify the order you
like.

Yves.
Reply all
Reply to author
Forward
0 new messages