I have the following data set that will be used to test the models by performing structural equation modeling:
- 3 Dependent variables (1 comorbid and 2 others)
- Age and Sex as covariates
- Independent variable (IV) : Latent Factor A (formed using Confirmatory factor analysis)
- 4 moderator variables (protective factors)
Each model will test the latent factor and all protective factors. I am using the laavan package to perform structural equation modeling.
I have began by opening my dataset from SPSS in R and installing the lavaan package.
I have come a long way since posting this question. Now, the only thing I need assistance with is figuring out how to account for age and sex as covariates in my structural equation models. I see that fixed.x is a line used in lavaan, but I am not sure if this will control for age and sex or if it is just setting the means and variances of all variables to random or not random.