Page 1 of 1

SEM and categorical variables

Posted: Mon Feb 06, 2023 9:24 am
by giotto
Hi, I am using the SEM module based on lavaan, which enables to set some variables as categorical by using the lavaan syntax. As I am not skilled with R, I was wondering if I can set these categorical variables in the interactive interface. If not, could you please add this option? It would be great, as I am doing a research. Thank you so much.

Re: SEM and categorical variables

Posted: Tue Feb 07, 2023 11:00 pm
by mcfanda@gmail.com
that depends on what you need to do. Options are already there for categorical variables, and they are the following:

1) if your categorical variables are meant to be independent variables of a model, you can use PATHj module, which handles categorical variables seamlessly, and allows for all sort of their effects (main effect, interactions, etc). https://pathj.github.io/

2) If your categorical variables are indicators of latent variables and their are multivalued, SEM analysis (not specifically SEMLj, but in general) accepts them as ordinal variables. You just need to set them as ordinal in the jamovi datasheet tab. (https://semlj.github.io/example3.html)

3) If your categorical variables are indicators of latent variables and their are dichotomous, just code them 1 and 0 and you're ready do go. If you set them as ordinal (as in point 2), SEMLj will use the polychoric correlation rather than Pearson correlations. https://lavaan.ugent.be/tutorial/cat.html

Re: SEM and categorical variables

Posted: Fri Feb 10, 2023 9:48 am
by giotto
Thank you so much for your prompt and very clear explanation.