I am conducting a second-order CFA in lavaan to measure intelligence. Several intelligence tests (bottom level) load onto factors (middle level, e.g., working memory) which load onto a general factor (top-level, called g-factor). My code looks like this:
model.IQ <- '
att =~ V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8
ver =~ V9 + V10 + V11
mem =~ V12 + V13
wme =~ V14 + V15
g =~ att + ver + mem + wme
'
Now I want to include age and gender as control variables but I don't know exactly how. I assume I would do this using the "~~" operator to add covariates, but onto which variables? Only the "g"? Or to V1-V15? It works if I add the following lines to my model, but does this work as intended?
V1 ~~ Age
V2 ~~ Age
...
V15 ~~ Age
V1 ~~ Gender
V2 ~~ Gender
...
V15 ~~ Gender
Thanks for your help!
Example of a second-order CFA:
For gender you should you multigroup confirmatory factor analysis (MGCFA), you ways of do it. My suggestion is to use the measurementInvariance()
, e.g.:
measurementInvariance(model = model.IQ, data = your.data.frame, group = "gender")
For categorical variables use the measurementInvarianceCat()
function.
Note that this function is deprecated, and it will probably disappear in the future.
For the age variable, I would use a MIMIC model (Wang, & Wang, 2012), where you use age
as a predictor of the general intelligence factor. MIMIC model stands for multiple indicator multiple cause model, in which multiple indicators reflect the underlying latent variables/factors and the multiple causes(observed predictors) affect latent variables/factors. You can conjugate both age and gender (dummy) in the same model.
model.IQ_mimic <- '
att =~ V1 + V2 + V3 + V4 + V5 + V6 + V7 + V8
ver =~ V9 + V10 + V11
mem =~ V12 + V13
wme =~ V14 + V15
g =~ att + ver + mem + wme
g ~ age + gender'
However, MGCFA has some advantages in comparison with MIMIC models, since MGCFA allows to test the measurement invariance of all model parameters. However, you can only proceed with MGCFA if you're using qualitative variables. MIMIC models may be advantageous due to the smaller sample size requirements and allowing to use of all kinds of variables.
Wang, J., & Wang, X. (2012). Structural equation modeling: Applications using Mplus. John Wiley & Sons. https://doi.org/10.4135/9781412956253.n563