Dear lavaan users,
I am using the measEq syntax that is available with the SEMTOOLS package. Structure of the model is that we have a measurement model with multiple latent variables, and we want to investigate measurement invariance of the model for males and females. I use the Wu & Estabrook parameterization.
I am trying to figure out how I can specify a model with configural measurement invariance, with the addition that we want a particular residual covariance to be 0 in one group, but freely estimated in the other group. Now I am encountering the problem, that when I specify such a model with these particular error covariances, lavaan does not return the estimates for these parameters (without any warnings). However, when I slighty change the model specifications (e.g., error covariance set to 1 - rather than 0 - in group 1 and freely estimated in group 2; or the error covariance in group 1 equal to error covariance in group 2) I do get estimates for these parameters, in line with the specifications. I have tried many different ways for specifying the model with 0 residual covariance in group 1 and freely in group 2 (e.g. as laid out in the lavaan tutorial: Q2new ~~ c(0,NA)*Q3new), but no success. Any thoughts on this? Some code that I have tried follows below:
many thanks for any suggestion,
John
# gender
# configural measurement invariance
# Specifying the baseline model
mod.cat <- '
group: 1
CF =~ Q20new + Q25new
EF =~ Q21new + Q22new + Q23new + Q24new
FAT =~ Q10new + Q12new + Q18new
PHF =~ Q1new + Q2new + Q3new + Q4new + Q5new
RF =~ Q6new + Q7new
SF =~ Q26new + Q27new
NAU =~ Q14new + Q15new
PAIN =~ Q9new + Q19new
GLOBAL =~ Q29new + Q30new
Q2new ~~ 0 *Q3new
group: 2
CF =~ Q20new + Q25new
EF =~ Q21new + Q22new + Q23new + Q24new
FAT =~ Q10new + Q12new + Q18new
PHF =~ Q1new + Q2new + Q3new + Q4new + Q5new
RF =~ Q6new + Q7new
SF =~ Q26new + Q27new
NAU =~ Q14new + Q15new
PAIN =~ Q9new + Q19new
GLOBAL =~ Q29new + Q30new
Q2new ~~ Q3new
#Q2new ~~ NA*Q3new
'
# Baseline model: no constraints across groups
baseline <- measEq.syntax(configural.model = mod.cat,
data = KeyAnalysisVars,
ordered = c("Q20new", "Q25new", "Q21new", "Q22new", "Q23new", "Q24new", "Q10new", "Q12new", "Q18new", "Q1new",
"Q2new" , "Q3new" , "Q4new", "Q5new", "Q6new", "Q7new",
"Q26new", "Q27new", "Q14new", "Q15new", "Q9new", "Q19new"),
parameterization = "delta",
ID.fac = "std.lv",
ID.cat = "Wu.Estabrook.2016",
group = "female",
group.equal = "configural"
)
# For a little bit of orientation/instructions in what model looks like.
summary(baseline)
# To see all of the constraints in the model
cat(as.character(baseline))
# Have to specify as.character to submit to lavaan
model.baseline <- as.character(baseline)
# Fitting baseline model in lavaan via cfa function
fit.baseline <- cfa(model.baseline, data = KeyAnalysisVars,
group ="female",
ordered = c("Q20new", "Q25new", "Q21new", "Q22new", "Q23new", "Q24new", "Q10new", "Q12new", "Q18new", "Q1new",
"Q2new" , "Q3new" , "Q4new", "Q5new", "Q6new", "Q7new",
"Q26new", "Q27new", "Q14new", "Q15new", "Q9new", "Q19new"),
cluster = "study",
information = "expected", missing = "pairwise")