Multiple Group SEM: Checking Starting Parameters

42 views
Skip to first unread message

Ari Fodeman

unread,
Nov 25, 2020, 3:21:42 PM11/25/20
to lav...@googlegroups.com
Hello Lavaan community,

I am a grad student still new to SEM and Lavaan. I am trying to compare an SEM between groups (I will test for invariance of model structure and path estimates).

My code is as follows:
####The model script
PaperII_all_Comp <- '
          AlcMark_Global =~ NA*AlcMarkExp_Comp + AlcMarkAll_Comp + AlcMarkAtt_Comp
         
          AlcMark_Global ~ 0
         
          AlcMark_Global ~~ 1*AlcMark_Global
         
          AlcMark_Global ~~ Q34
         
          AlcAtt_Global =~ NA*FriAlcAtt_Comp + AduAlcAtt_Comp + YouAlcAtt_Comp
         
          AlcAtt_Global ~~ 1*AlcAtt_Global
         
          AlcAtt_Global ~ 0
         
          AlcAtt_Global ~~ Q28
         
          Q25 ~ AlcMark_Global + AlcAtt_Global + Q4_X_Rv + Q5_ZRc_Int + Q19 + SES_Comp
          DrinkAmo_Comp ~ AlcMark_Global + AlcAtt_Global + Q4_X_Rv + Q5_ZRc_Int + Q19 + SES_Comp + Q25
          DrinkHeav_Comp ~ AlcMark_Global + AlcAtt_Global + Q4_X_Rv + Q5_ZRc_Int + Q19 + SES_Comp + Q25 + DrinkAmo_Comp
          DrinkProb_Comp ~ AlcMark_Global + AlcAtt_Global + Q4_X_Rv + Q5_ZRc_Int + Q19 + SES_Comp + Q25 + DrinkAmo_Comp + DrinkHeav_Comp
         
          Q4_X_Rv ~~ Q5_ZRc_Int
         
          AlcMark_Global ~~ AlcAtt_Global
         
          AlcMarkExp_Comp ~ 1
          AlcMarkAll_Comp ~ 1
          AlcMarkAtt_Comp ~ 1
          FriAlcAtt_Comp ~ 1
          AduAlcAtt_Comp ~ 1
          YouAlcAtt_Comp ~ 1
          Q4_X_Rv ~ 1
          Q5_ZRc_Int ~ 1
          Q19 ~ 1
          SES_Comp ~ 1
          Q3_X ~ 1
          DrinkAmo_Comp ~ 1
          DrinkHeav_Comp ~ 1
          DrinkProb_Comp ~ 1
         
         
          '
###This model fits the dataset as a whole just fine
PaperII_all_Comp_CFA <- sem(PaperII_all_Comp, data = Kampala,  estimator = "MLR",missing="FIML")
summary(PaperII_all_Comp_CFA)
####Split it into two groups, however, and I get an error message below
PaperII_all_Comp_CFA_Groups <- sem(PaperII_all_Comp, data = Kampala,  estimator = "MLR",missing="FIML",
                                   group = "Q3_X_LFZRv")

summary(PaperII_all_Comp_CFA_Groups)

This is the error message:
"
rror in lav_model_estimate(lavmodel = lavmodel, lavpartable = lavpartable,  :
  lavaan ERROR: initial model-implied matrix (Sigma) is not positive definite;
  check your model and/or starting parameters in group 1.
"

How do I check the starting parameters for "group 1?" Why might the matrix not be positive definite for the group estimate, but is for estimating the data as a whole?

Best wishes,
-Ari

Terrence Jorgensen

unread,
Nov 26, 2020, 5:21:41 AM11/26/20
to lavaan
Why might the matrix not be positive definite for the group estimate, but is for estimating the data as a whole?

They are different data.   There might be linear dependency in one group but not another.  Do all variables have SDs>0 within each group?

You syntax constraints seem consistent with the fixed-factor identification method, which you can trigger automatically with the argument std.lv=TRUE.  Regardless, the default is to fix latent intercepts to zero, so you don't need 
AlcMark_Global + AlcAtt_Global ~ 0*1 # more correct than simply ~0

You have many exogenous predictors, whose means and (co)variances can simply be taken as given to simplify estimation (lavaan's default is fixed.x=TRUE, meaning exogenous-variable parameters are assumed fixed to their sample statistics rather than estimated); that is, remove all those intercepts (and the one covariance you specified: Q4_X_Rv ~~ Q5_ZRc_Int) from your syntax.

I'm not sure why you estimate these 2 covariances:

AlcMark_Global ~~ Q34
AlcAtt_Global ~~ Q28

If they are to be used as auxiliary variables, then the semTools::auxiliary() function can automate the saturated-correlates approach.  If you want to know how those variables correlate with the latent factors, then you could treat them as single-indicator constructs:

FQ34 =~ Q34
FQ28 =~ Q28

sem() will automatically fix their residual variances to 0, so all their variance is represented at the latent level. Furthermore, their factors can be standardized (free the single-indicator loadings) so the covariances with other factors (also automatically estimated) will be correlations.  Most importantly, treating them as single-indicator constructs will mean they are endogenous, so you can still treat the other exogenous variables as fixed to simplify estimation (and hopefully avoid your error message).  To use the FIML approach with exogenous covariates, also set
  missing = "fiml.x"

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