James
James

Reputation: 561

SEM (Structural Equation Model) Moderated Mediation but returns with "information matrix could not be inverted warning"

I'm building a structural equation model that incorporates 4 latent variables: personal lifestyle, social lifestyle, trauma score, and the DV (well-being).

Sample = 360 people.

I've included the final model below. "pl" and "sl" represent personal and social lifestyle. The moderated mediation flows from trauma to resilience (and then the interactions with pl and sl on resilience) to well-being. There are also interactions on pl and sl with trauma in the direct pathway. Here's also a path diagram I whipped up. enter image description here

This is the full warning I receive when running the model:

Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.

I've used 114 DF and have 61 free parameters (model test baseline uses 147), so I'd be surprised if it's an issue of under-identification, but I also wanted to make sure that I was correctly specifying the model in Lavaan. The SEs I will compute with bootstrapping anyway; but I think this is an issue beyond merely the SEs. The fit is not good (SRMR .119), but I'd imagine that could improve with mod indices; still there's something that doesn't seem right here. Also worth noting that even if I remove the interactions on resilience score, but not the direct pathway, I still get the same warning.

I've included some data here: https://drive.google.com/file/d/1AX50DFNik30Qsyiyp6XnPMETNfVXK83r/view?usp=sharing

Thanks much!


fit.latent_mod_med <- '#factor loadings; measurement model portion
pl =~ exercisescore + mindfulnessscore + promistscore
sl =~ family_support + friendshipcount + friendshipnet + sense_of_community + emotionalsupportscore
trauma =~ neglectscore + abusescore + exposure
wb =~ depressionscore + anxietyscore

#regressions: structural model
  wb ~ age + gender + ethnicity + sesscore + pl:resiliencescore + sl:resiliencescore + pl:trauma + sl:trauma
  resiliencescore ~ age + sesscore + trauma
'

fit.latent_mod_med <- sem(fit.latent_mod_med, data = total, meanstructure = TRUE, std.lv = TRUE)

Upvotes: 1

Views: 397

Answers (1)

hamagust
hamagust

Reputation: 854

not sure if the error message has with this, but, for what I know, you need to generate the interaction term previously (as pre-treatment), not specify it directly into the model...

I mean, if you have, for example, computed the factor scores for each latent variable:

total$pl_resiliencescore = total$pl*total$resiliencescore
total$sl_resiliencescore =total$sl *total$resiliencescore 
total$pl_trauma =total$pl*total$trauma 
total$sl_trauma=total$sl*total$trauma
fit.latent_mod_med <- '#factor loadings; measurement model portion
    pl =~ exercisescore + mindfulnessscore + promistscore
    sl =~ family_support + friendshipcount + friendshipnet + sense_of_community + emotionalsupportscore
    trauma =~ neglectscore + abusescore + exposure
    wb =~ depressionscore + anxietyscore
    
    #regressions: structural model
      wb ~ age + gender + ethnicity + sesscore + pl_resiliencescore + sl_resiliencescore + pl_trauma + sl_trauma
      resiliencescore ~ age + sesscore + trauma
    '
    
fit.latent_mod_med <- sem(fit.latent_mod_med, data = total, meanstructure = TRUE, std.lv = TRUE)

Another alternative is to use the indprod function from semTools package...

Upvotes: 1

Related Questions