Help needed with moderation in SEM using lavaan package

236 views
Skip to first unread message

walkywalky

unread,
Aug 23, 2019, 5:12:52 PM8/23/19
to lavaan
Dear all,

I am trying to run a moderation analysis using lavaan.

I have a model with a number of latent variables and single-item observed indicators. 

First, I defined the measurement model as follows

1) measurement model
mod.PE <-' PE =~ V2_PE1 + V2_PE2 
EE =~ V2_EE1 + V2_EE2 + V2_EE3
SI =~ V2_SI1 + V2_SI2 + V2_SI3 
BI =~ V2_BI1 + V2_BI2 + V2_BI3
HM =~ V2_HM1 + V2_HM2 + V2_HM3
FC =~ V2_FC1 + V2_FC2 + V2_FC4 
PE ~~ EE
PE ~~ SI
PE ~~ HM
PE ~~ FC
EE ~~ SI
EE ~~ HM
EE ~~ FC
SI ~~ HM
SI ~~ FC
HM ~~ FC
BI ~~ PE
BI ~~ EE
BI ~~ SI
BI ~~ FC
BI ~~ HM '
fit.PE <- lavaan::cfa(mod.PE,
data = Datensatz_neu.sav,
missing="FIML",
estimator = "ML")
summary(fit.PE, standardized=TRUE, fit.measures=TRUE)

2)I then defined the structural model as follows and included observed single-item indicators as well:
mod.PE <-' PE =~ V2_PE1 + V2_PE2 
EE =~ V2_EE1 + V2_EE2 + V2_EE3 
SI =~ V2_SI1 + V2_SI2 + V2_SI3
BI =~ V2_BI1 + V2_BI2 + V2_BI3
HM =~ V2_HM1 + V2_HM2 + V2_HM3
FC =~ V2_FC1 + V2_FC2 + V2_FC4 
BI ~ PE + EE + SI + FC + HM + CarUse + PublicTransportUse + TechAcceptance + NoInteractions + NoUses + EE * CarUse
PE ~ FC + EE + HM + SI + CarUse + PublicTransportUse + TechAcceptance + NoInteractions + NoUses 
EE ~ FC + SI + HM + CarUse + PublicTransportUse + TechAcceptance + NoInteractions + NoUses 
HM ~ FC + SI + CarUse + PublicTransportUse + TechAcceptance + NoInteractions + NoUses 
FC ~ SI + CarUse + PublicTransportUse + TechAcceptance + NoInteractions + NoUses 
SI ~ TechAcceptance
'
fit.PE <- lavaan::cfa(mod.PE,
data = Datensatz_neu.sav,
missing="FIML",
estimator = "ML")
summary(fit.PE, standardized=TRUE, fit.measures=TRUE, rsquare = TRUE)


I noticed that the effect of car use on BI is significant and that EE becomes significant when car use is included in the model. Hence, I want to check whether car use moderates the relation between EE and BI.  

3) I performed mean centering now using this function for BI, EE and car use: variableCarUse.c <- scale(Datensatz_neu.sav$CarUse, center = TRUE, scale = FALSE)

4) I then performed a simple regression using the lm function and find a significant moderation effect.


Coefficients:
                             Estimate Std. Error t value Pr(>|t|)    
(Intercept)                  -0.03953    0.07905  -0.500   0.6174    
variableEEc                   0.55832    0.06579   8.487  8.8e-16 ***
variableCarUse.c             -0.06340    0.02722  -2.329   0.0205 *  
variableEEc:variableCarUse.c -0.05975    0.02715  -2.201   0.0285 *  

--Now my question: Ideally I want to include all latent variables as defined in the measurement model to see whether moderating effect is robust in the multivariate latent context, or is it also ok to check for moderating effects only with the M, the IV and DV in one model as I did with the function lm?

If it is not ok, how do I have to specify my measurement model? Somehow I don't know now how to include the interaction term in the model. 

-- I also added the interaction term in the structural model of step 2 before  (EE*Car Use) and I also found a significant effect but I think this is not correct because I when I add the interaction effect of Car use * SI or car use * FC, the interaction term is 1) always the same for every variable and 2) it is the same as the single effect of car use on the outcome variable. 
Something is wrong here I guess. 

Thanks a lot.

I hope my clarifications are clear. 

Terrence Jorgensen

unread,
Aug 25, 2019, 8:13:46 AM8/25/19
to lavaan
I noticed that the effect of car use on BI is significant and that EE becomes significant when car use is included in the model.

This is called "suppression", not moderation.

https://doi.org/10.1023/A:1026595011371 (suppression, confounding, mediation)



I don't know now how to include the interaction term in the model. 

Use product indicators of a latent interaction, as you tried in one of your other 2 posts on this topic:


I also added the interaction term in the structural model of step 2 before  (EE*Car Use) 

That syntax does not multiple 2 variables to create an interaction term.  lavaan's ?model.syntax is a character string that does NOT follow all the rules of a ?formula object.  This syntax just labels the CarUse slope "EE".

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

Sina Nordhoff

unread,
Aug 28, 2019, 9:55:16 AM8/28/19
to lav...@googlegroups.com
Thanks a lot! 
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/4eb1e9f3-e3bb-405f-be73-bfffd803a17f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages