Help with unordered categorical variable

134 views
Skip to first unread message

Anjana Rajagopal

unread,
Jan 18, 2023, 2:28:02 AM1/18/23
to lavaan
Hi,

I am trying to fit RI-CLPM into my data which has two variables (X and Y) across 5-time points. X is a numerical variable while Y is a binary/dichotomous variable. I am getting the following error while using 'lavaan' package in R.

Screenshot 2023-01-18 172542.png

Can someone please help me if I can do RI-CLPM with an unordered categorical variable? I saw in the FAQs that Mplus v8.7 can deal with categorical data, so has it not yet been updated in the 'lavaan' R package?

Thanks,
Aj


Terrence Jorgensen

unread,
Jan 19, 2023, 4:19:23 AM1/19/23
to lavaan
Y is a binary/dichotomous variable

Then it is arbitrary to consider it (un)ordered.  
 
do RI-CLPM with an unordered categorical variable?

Not in lavaan.  And it is binary, so just change its class to ordered()

I saw in the FAQs that Mplus v8.7 can deal with categorical data, so has it not yet been updated in the 'lavaan' R package?

Mplus does the same thing with binary data that lavaan does.  But Mplus also implements a nominal response model, which is only relevant for multinomial (not binary) categorical variables.

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

Yves Rosseel

unread,
Jan 30, 2023, 9:18:57 AM1/30/23
to lav...@googlegroups.com
lavaan cannot handle endogenous (depenent) unordered categorical variables.

But if your variables are binary, you should use the ordered= argument
to inform lavaan. See

https://lavaan.ugent.be/tutorial/cat.html

Yves.


On 1/18/23 08:28, Anjana Rajagopal wrote:
> Hi,
>
> I am trying to fit RI-CLPM into my data which has two variables (X and
> Y) across 5-time points. X is a numerical variable while Y is a
> binary/dichotomous variable. I am getting the following error while
> using 'lavaan' package in R.
>
> Screenshot 2023-01-18 172542.png
>
> Can someone please help me if I can do RI-CLPM with an unordered
> categorical variable? I saw in the FAQs that Mplus v8.7 can deal with
> categorical data, so has it not yet been updated in the 'lavaan' R package?
>
> Thanks,
> Aj
>
>
> --
> 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
> <mailto:lavaan+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lavaan/86c2bfa6-463c-4947-9235-3edc9b9fe80cn%40googlegroups.com <https://groups.google.com/d/msgid/lavaan/86c2bfa6-463c-4947-9235-3edc9b9fe80cn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages