Exogenous categorical variable too many levels

104 views
Skip to first unread message

Kun Li

unread,
Aug 24, 2018, 4:04:19 PM8/24/18
to lavaan
Hi all,

I have an exogenous variable with 9 categories (9 different groups). If I understand correctly of the lavaan tutorial, I need to create 8 dummy variables to represent this one categorical variable. In this way, do I need to add 28 (8*7/2) covariances for the 8 dummy variables in my model? I guess I don't quite understand what the syntax looks like for dummy exogenous variables in sem. Or should I cluster similar groups first to reduce the levels? Thanks in advance!

X1~~X2
X1
~~X3
X1
~~X4
...
X7
~~X6
X7
~~X8


Kun

Kun Li

unread,
Aug 24, 2018, 5:04:43 PM8/24/18
to lavaan
EDIT:
I think I don't include pairwise covariance, but each dummy variable should regress to the endogenous variable, correct? Like:
latent~X1
latent
~X2
...
latent
~X8

Terrence Jorgensen

unread,
Aug 25, 2018, 8:38:19 AM8/25/18
to lavaan
I don't quite understand what the syntax looks like for dummy exogenous variables in sem. 

If you set fixed.x = TRUE, you don't need to include them at all (lavaan will just use their observed sample statistics instead of estimating them).  Just regress any endogenous variables on them.

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Kun Li

unread,
Aug 28, 2018, 12:07:04 PM8/28/18
to lavaan
Thanks! I think I understand it better now. 
Reply all
Reply to author
Forward
0 new messages