On 05/09/2014 09:16 PM, Yolande Tra wrote:
> Hi,
> I have a nominal exogenous variable with 4 categories. Here is my
> syntax, where I got a warning. The example in the tutorial says to
> create 3 dummy variables. I used contrast for dummy coding
>
http://lavaan.ugent.be/tutorial/cat.html
>
> skeptic$INFOH<-factor(skeptic$INFOH)
> contrasts(skeptic$INFOH)<-contr.treatment(4)
lavaan (0.5) does NOT automatically expand a factor into a set of dummy
variables (unlike, say lm() and glm()). You need to construct the dummy
variables yourself (say, INFOH1, INFOH2 and INFOH3), and then you can
use those three exogenous dummy variables in your model syntax.
Yves.