Re: [R] binary exogenous variable in path analysis in sem or lavaan

From: yrosseel <>
Date: Thu, 24 Mar 2011 01:04:11 -0700 (PDT)


If 'sex' is indeed an exogenous variable (ie. predictor only), you can simply code it as (1=male, 2=female) and use it as a covariate in any sem model. In lavaan, you can explicitly use the argument 'fixed.x=TRUE', which will regard all exogenous covariates as fixed variables. Their means/variances/covariances are not included in the model estimation (so they do not have to be normally distributed), but they are simply set at their sample values. In essence, this is exactly what happens in ordinary regression, when a categorical predictor is recoded as a dummy variable.


View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 24 Mar 2011 - 08:46:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Mar 2011 - 10:00:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive