Moderated mediation with latent moderator + mediator

147 views
Skip to first unread message

Onur Şahin

unread,
Feb 10, 2019, 5:39:30 PM2/10/19
to lavaan
Hi all,

I posted a question here a while ago, while Edward Rigton and Terrence Jorgerson took their time to help me (thanks guys!), it seems that my approach back then was not the best one.

I want to conduct a moderated mediation analysis with latent DV's, moderator and mediator. The IV's will not be latent, as they are single item. 

My issue is with the latent moderator. How does one approach this? The way I have it now, I calculate interaction terms before the SEM model, so I input the interaction terms in my model. Furthermore, I look at the moderation at -1 SD, mean and +1 SD of the moderator. I'm not sure whether this is possible with a latent variable. See my code below:

SEMdata$X1xW <- with(SEMdata, as.numeric(X1)*W) ## I need to create the interaction terms before the model, so I can use these new variables in the model. Not possible if I use a latent variable right? I think SEMtools has an option though, but is it possible for all these interactions? 
SEMdata$X2xW <- with(SEMdata, as.numeric(X2)*W)
SEMdata$X1xX2 <- with(SEMdata, as.numeric(X1)*as.numeric(X2))
SEMdata$X1xX2xW <- with(SEMdata, as.numeric(X1)*as.numeric(X2)*W)

mean_of_W <- mean(SEMdata$W, na.rm = T)
var_of_W <- var(SEMdata$W, na.rm = T)

model <- "

D1 =~ d11+ d12+ d13+ d14+ d15
D2 =~ d21+ d22+ d23+ d24+ d25
D3 =~ d31+ d32+ d33+ d34+ d35
D4 =~ d41+ d42+ d43+ d44+ d145
D5 =~ d51+ d52+ d53+ d54+ d55 

M =~ item1+item2+item3+item4+item4     ####(this is the mediator)

### Ideally I also would have:
# W =~ Witem1+Witem2 etc. but I have no idea how I can test the moderation in this way

M ~ a1*X1
M ~ a2*X2

D1 ~ b1*M
D2 ~ b2*M
D3 ~ b3*M
D4 ~ b4*M
D5 ~ b5*M


M~ a3*W  ### W is the moderator! I want this to be a latent variable as well but have no idea how to approach this
M~ a4*X1xW
M~ a5*X2xW
M~ a6*X1xX2
M~ a7*X1xX2xW

D1 ~ c1*X1
D1 ~ c6*X2
D2 ~ c2*X1
D2 ~ c7*X2
D3~ c3*X1
D3~ c8*X2
D4~ c4*X1
D4 ~ c9*X2
D5~ c5*X1
D5~ c10*X2

W ~ mean_of_W*1
W ~~ var_of_W*W

D1 ~ c11*W
D2 ~ c12*W
D3 ~ c13*W
D4 ~ c14*W
D5 ~ c15*W

X1xW ~~ X2xW ## I think these covariances are necessary, 
X1 ~~ X2
X1 ~~ X1xW
X2 ~~ X2xW

SD.below_X1_M := a1 + a4*(mean_of_W- sqrt(var_of_W)) ## This part can be ignored, but acts as an example to see how I test the moderation. I do this for all DV's as well
mean_X1_M := a1 + a4*(mean_of_W)
SD.above_X1_M := a1 + a4*(mean_of_W + sqrt(var_of_W))

Terrence Jorgensen

unread,
Feb 19, 2019, 2:48:24 PM2/19/19
to lavaan
My issue is with the latent moderator. How does one approach this? 

Use Mplus.... sorry, but I think your model is already too large for product-indicators to be a viable solution.  Mplus is the only SEM package that enables LMS for latent interactions, except the R package nlsem (which you can try, but the syntax is difficult, and I was unable to make it work to estimate an interaction between latent and observed predictors).

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

Onur Şahin

unread,
Feb 19, 2019, 2:56:59 PM2/19/19
to lav...@googlegroups.com
Thank you for taking the time to help me out, much appreciated. I think I'll just forget about the latent moderator.

Best,

Onur

--
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+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages