Multiple Mediation with covariates

782 views
Skip to first unread message

Chia-Hao Shih

unread,
Nov 30, 2018, 11:07:28 AM11/30/18
to lavaan
Dear all,

I am trying to run a multiple mediation model in lavaan with 1 predictor (X), 4 parallel mediators (M1, M2, M3, M4), and 3 variables that I want to control for (i.e., age, duration, and severity). I wonder if someone could check my syntax and let me know if my model specification is correct. Thanks in advance.

Model <- ' 
      X ~ b1 * M1 + b2 * M2 + b3 * M3 + b4 * M4 + c1 * X + c2 * age + c3 * duration + c4 * severity
     C1 ~ a1 * X + a5 * age + a6 * duration + a7 * severity
     C2 ~ a2 * X + a8 * age + a9 * duration + a10 * severity
     C3 ~ a3 * X + a11 * age + a12 * duration + a 13 * severity
     C4 ~ a4 * X + a14 * age + a15 * duration + a 16 * severity
     indirect1 := a1 * b1
     indirect2 := a2 * b2
     indirect3 := a3 * b3
     indirect4 := a4 * b4
     total := c1 + c2 + c3 + c4 + (a1 * b1) + (a2 * b2) + (a3 * b3) + (a4 * b4)
     C1 ~~ C2
     C1 ~~ C3
     C1 ~~ C4
     C2 ~~ C3
     C2 ~~ C4
     C3 ~~ C4
'
require(lavaan)
fit <- sem(model = Model, data = Data, se = "bootstrap", bootstrap = 5000)
summary(fit, estimates = TRUE, ci = TRUE)

Christopher David Desjardins

unread,
Nov 30, 2018, 4:17:02 PM11/30/18
to lav...@googlegroups.com
Hi, 
This isn't quite right. If M1 though M4 are mediators then need to be on the left-hand side. Also, is each mediator associated with a single C outcome? I'm assuming that below:

Model <- '

# Mediator is regressed on to X
M1 ~ b1*X + age + duration + severity
M2 ~ b2*X + age + duration + severity
M3 ~ b3*X + age + duration + severity
M4 ~ b4*X + age + duration + severity

# Y (Cs) is regressed onto mediator and X
C1 ~ c1*X + b1*M1 + age + duration + severity
C2 ~ c2*X + b1*M2 + age + duration + severity
C3 ~ c3*X + b1*M3 + age + duration + severity
C4 ~ c4*X + b1*M4 + age + duration + severity

indirect1 := a1 * b1
indirect2 := a2 * b2
indirect3 := a3 * b3
indirect4 := a4 * b4

totalC1 := c1 + (a1 * b1)
totalC2 := c2 + (a2 * b2)
totalC3 := c3 + (a3 * b3)
totalC4 := c4 + (a4 * b4)
'

But I am just guessing this is what you want ...
--
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.

Chia-Hao Shih

unread,
Dec 1, 2018, 9:01:25 PM12/1/18
to lavaan
Hi Chris,

Thanks for your reply. I realized that I made typos on the original syntax: the C1 to C4 (capital C) should be M1 to M4 and X should be Y. Also, based on your reply, I guess I don't need to assign coefficients to my covariates. Below is my revised syntax, hope you or other people in the group could give me feedback. Thank you.

Model <- ' 
      Y ~ b1 * M1 + b2 * M2 + b3 * M3 + b4 * M4 + c1 * X + age + duration + severity
     M1 ~ a1 * X +  age +  duration +  severity
     M2 ~ a2 * X +  age +  duration +  severity
     M3 ~ a3 * X +  age +  duration +  severity
     M4 ~ a4 * X +  age +  duration +  severity
     indirect1 := a1 * b1
     indirect2 := a2 * b2
     indirect3 := a3 * b3
     indirect4 := a4 * b4
     total := c1 + (a1 * b1) + (a2 * b2) + (a3 * b3) + (a4 * b4)
     M1 ~~ M2
     M1 ~~ M3
     M1 ~~ M4
     M2 ~~ M3
     M2 ~~ M4
     M3 ~~ M4

Christopher Desjardins

unread,
Dec 2, 2018, 8:56:48 AM12/2/18
to lav...@googlegroups.com
This looks fine to me. It’s not necessarily clear to me that you need to allow your mediators to covary. So, you could remove that. Do you have a reason or a citation as to why you are covarying them?

You might also be interested in the size of each indirect effect. For example, maybe you want this in your code?

a1b1 := a1*b1
a2b2 := a2*b2

If you think the effects are the same for each regression, then you can assign labels to age, duration, and severity. Otherwise, it’s fine to leave them without the labels.

Chris 
Message has been deleted

Chia-Hao Shih

unread,
Dec 3, 2018, 8:57:32 AM12/3/18
to lavaan

Hi Chris,

I really appreciate your help. As you pointed out, I don't need my mediators to covary with each other. I saw a sample lavaan syntax online and didn't think it through. Thank you again.

Best,
James
Reply all
Reply to author
Forward
0 new messages