Moderated mediation: conditional IDEs syntax

131 views
Skip to first unread message

Błażej Mroziński

unread,
Feb 20, 2019, 6:45:16 AM2/20/19
to lavaan
Greetings,

I'd like to ask you for some guidance in specifying properly a mediated moderation model in lavaan.

Following Hayes PROCESS macro templates i'm setting model 14:

X is experimental condition coded as 0 - 1, V, M and Y are all continues (mean scores of discrete questionnaire items).

I mean centered all but Y, computed a product of M * V and now I'd like to code all the effects.

mod14 <- '
M ~ a*X
Y ~ c*X + b*M + V + MV

indirect:= a * b
direct := c
total := c + (a*b)'


What I'd like to add here is what output from PROCESS macro calls:
  • Conditional effects of the focal predictor at values of the moderator(s):
  • Conditional effect of focal predictor at values of the moderator
  • Conditional indirect effects of X on Y
  • Index of moderated mediation
I woud appreciate some help,
Thank you

Błażej Mroziński

unread,
Feb 20, 2019, 7:19:30 AM2/20/19
to lavaan
Following hints found here

I came up with this syntax:

mod14 <- '
M ~ a*X
Y ~ c*X + b*M + b2*V + b*MV


indirect:= a * b
direct := c
total := c + (a*b)

ab3 := a * b3 #index of moderated mediation?
lowV := a * b1 + ab3 * -0.5
highV := a * b1 + ab3 * 0.5
'

Would this be correct?

'

Terrence Jorgensen

unread,
Feb 21, 2019, 3:28:10 PM2/21/19
to lavaan
Would this be correct?

You need to label b1 and b3 correctly in your syntax, and put parentheses around the added terms that make up the simple slope of the b path.

a * (b1 + ab3 * -0.5)

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

Aybike Çavdar

unread,
Feb 25, 2024, 1:05:10 PMFeb 25
to lavaan
Hi all,
I had similar problems and mailed it to the group. When I look for answer I found your conversation. Different from the question above, I will run model 15 which moderator has an impact on x to y path. My data set name is IntOrnek and the grouping variable is country. Variables are X (predictor), Y(outcome), M (mediator between X-Y), V(moderator between X-Y and M-Y). Path names are as following:
X -> Y  "c1"
X -> M "a"
M -> Y "b1"
V -> Y  "c2"
VM -> Y "b2"
VX -> Y "c3"

According to that, I wrote the following, 
model15 <- ' M ~ a*X
           Y ~ c1*X + b1*M + c2*V + b2*VM + c3*VX
           conditional indirect := a(b1 + b2*V)
           conditional direct := c1 + c3*V
           total :=  a(b1 + b2*V) +  c1 + c3*V
           index.mod.med := a*b2*c3       #Should I add “b2” as well? is the correct calculation multiplication or addiction?
           Vlow := a*b1 + a*b2*c3*-0.5 # If the previous index calculation correct
   Vhigh := a*b1 + a*b2*c3*0.5
   V ~ V.mean * 1
           V ~~ V.var * V
   total.SDbelow :=  direct + indirect
# Ensure country variable is character
   IntOrnek$country <- as.character(IntOrnek$country)'
 # Fit the multigroup model
> Model15Sem <- sem(Model15, data = IntOrnek, estimator = "MLR", missing = "ML", group = "country")


Does it make sense to compare two samples in terms of the model and effect of the moderator? I am not sure if I have written the indirect and conditional effect codes correctly. Since I am new to R, I find it difficult to interpret the examples I find and adapt them to my model. None of the examples have a moderator on the c' path.
I am not sure if it makes sense to define the model this way.
Any contribution would be greatly appreciated.
Thanks in advance. 

21 Şubat 2019 Perşembe tarihinde saat 23:28:10 UTC+3 itibarıyla Terrence Jorgensen şunları yazdı:
Reply all
Reply to author
Forward
0 new messages