fixed group-specific residual covariances with measEq.syntax {SEMTOOLS} not always estimated

73 views
Skip to first unread message

John Gelissen

unread,
Apr 13, 2020, 6:10:08 PM4/13/20
to lavaan
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")

Terrence Jorgensen

unread,
Apr 16, 2020, 4:30:37 AM4/16/20
to lavaan
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.

Then you do not even have configural invariance?  A residual covariance only in Group 1 implies another common factor only in that group, although specifying it would change the interpretation of those indicators' (cross-)loadings.  Does your theory indicate there should be another (method?) factor for those 2 indicators, or a reason their residuals should be correlated only in Group 1?  If you are basing this on post-hoc statistics to improve the fit of your configural model, you should be wary of making group-specific adjustments that are subject to sampling error (e.g., if the covariance was significant in one group but not the other, that does not imply that the differences between estimated covariances was significant: https://doi.org/10.1198/000313006X152649 ).  See a method here for testing parameters simultaneously across groups, and for testing configural invariance without conflating with other sources of misfit:



 
when I specify such a model with these particular error covariances, lavaan does not return the estimates for these parameters (without any warnings).

lavaan is fitting the model your syntax tells it to fit.  If semTools::measEq.syntax() is writing your syntax, then that is the source of the issue.
 
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? 

Because configural invariance requires the same model configuration in both groups (and any more restrictive levels of invariances are predicated on configural invariance), I did not code any logic to catch this particular combination.  I flag parameters that need to be specified by checking whether they are free or fixed to nonzero values in the first group.  If you fix it to zero in group 1, it just won't catch any free/nonzero specifications in other groups.  See in this reproducible example that only the 3rd residual covariance is not specified in the generated model syntax:

mod.cat <- ' FU1 =~ u1 + u2 + u3 + u4
             FU2 =~ u5 + u6 + u7 + u8
  u1 ~~ c(NA, 1)*u5
  u2 ~~ c(NA, 0)*u6
  u3 ~~ c(0, 1)*u7  # only this is not flagged to specify
  u4 ~~ c(1, 0)*u8
'

syntax
.config <- measEq.syntax(configural.model = mod.cat, data = datCat,
                               ordered
= paste0("u", 1:8),
                               parameterization
= "theta", group = "g")
cat
(as.character(syntax.config))

I might eventually add a check in other groups to warn people when they specify models that violate configural invariance, but for now I would just suggest that you reevaluate whether to freely estimate the covariance in both groups.

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages