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
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))