SEM and categorical variables

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
giotto
Posts: 2
Joined: Mon Feb 06, 2023 9:20 am

SEM and categorical variables

Post 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.
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: SEM and categorical variables

Post 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
giotto
Posts: 2
Joined: Mon Feb 06, 2023 9:20 am

Re: SEM and categorical variables

Post by giotto »

Thank you so much for your prompt and very clear explanation.
Post Reply