As a newbie in lavaan I got confused with categorical data.Somebody would clarify?
If I have:
Exogenous variables
1 binary (Gender: 0 MALE 1 FEMALE)
1 ordinal (BMI: 1 NORMAL, 2 OBESE, 3 OVERWEIGHT)
Question: In this case I recode GENDER and RACE as dummy and tranform it in numeric and for BMI only transform in numeric?
Endogenous variables:
1 Binary variable (HAS DIABETES: 0 NO 1 YES)
1 ORDINAL variable (PAIN LEVEL: 1 - NO PAIN 2 MODERATE 3 SEVERE)
Question: Keep all as categorical, but tranform it as ordered factor and use
pa.model <- SEM(myModel, data = myData,ordered=c("DIA","PAIN"))
?
And nominal variables as endogenous? How to work with them?
I recode GENDER and RACE as dummy and tranform it in numeric
and for BMI only transform in numeric?
Endogenous variables:
Keep all as categorical, but tranform it as ordered factor and use
pa.model <- SEM(myModel, data = myData,ordered=c("DIA","PAIN"))
?
And nominal variables as endogenous? How to work with them?