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

yrosseel yrosseel at gmail.com
Thu Mar 24 09:04:11 CET 2011


Rob,

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.

Yves.

--
View this message in context: http://r.789695.n4.nabble.com/binary-exogenous-variable-in-path-analysis-in-sem-or-lavaan-tp3355987p3401870.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list