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

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

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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive