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

From: Rob Knell <R.Knell_at_qmul.ac.uk>
Date: Tue, 15 Mar 2011 08:22:02 +0000

Hello all

I'm trying to run some path analysis in either sem or lavaan (preferably lavaan because I find its interface easier to use). Most of my variables are continuously distributed and fairly well-behaved but I have a single exogenous variable (sex) which is not continuously distributed. Preliminary model fitting suggests that there aren't any sex by (anything else) interactions. The two approaches to dealing with this that I've come up with are to code it as a numerical variable (1 & 2 for female and male) and run the analysis as normal, or to run two separate models, one for males and one for females. I'd prefer to do the former because it will make interpretation easier and also give a larger sample size for the model fit but I'm not sure how acceptable that is. I know that some SEM packages are able to cope with categorical variables - is there any way to do this in R?

Thanks for any help



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 Tue 15 Mar 2011 - 08:24:18 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 - 09:10:24 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