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

Rob Knell R.Knell at qmul.ac.uk
Tue Mar 15 09:22:02 CET 2011


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

Regards

Rob


More information about the R-help mailing list