Hi there,
I am using a categorical variable (3 levels) as a covariate (independent/exogenous variable) in my sem model.
Since I know, this variable is needed to be recorded as a dummy (K-1) variable.
I did this by model.matrix() function. I checked the results, and I got the two (k-1) new dummy variables.
res <- model.matrix(~Category, data = data)
head(res)
head(res[, -1])
But when I run my sem model:
It still shows 'lavaan ERROR: unordered factor(s) with more than 2 levels detected as exogenous covariate(s): Category'
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/4582877a-1fb7-4339-a82a-75fdd6fd0952n%40googlegroups.com.