define moderated mediation model using lavaan syntax

90 views
Skip to first unread message

Francesco Cabiddu

unread,
Jun 17, 2019, 3:07:25 PM6/17/19
to lavaan
I am a beginner and I am trying to define a model in lavaan that consists of  13 latent variables (x1...x7, x9...x12, y=outcome) and an observed variable (x8). There are 2 moderations and 2 moderated mediations.

The analysis refers to a survey study using Likert-scale items all going from 1 to 7.

My attempt is the following: 

mod <- "
X0=~ x0.1 + x0.2 + x0.3 
X1=~ x1.4 + x1.5 + x1.6 + x1.7
X2=~ x2.8 + x2.9 + x2.10 +x2.11 + x2.12 + x2.13 + x2.14 + x2.15 + x2.16 + x2.17 + x2.18 + x2.19 
X3=~ x3.20 + x3.21 + x3.22 + x3.23
X4=~ x4.24 + x4.25 + x4.26 + x4.27
X5=~ x5.28 + x5.29 + x5.30 + x5.31 + x5.32 +x5.33
X6=~ x6.34 + x6.35 + x6.36 + x6.37
X7=~ x7.38 + x7.39 + x7.40 + x7.41 + x7.42
X9=~ x9.43 + x9.44 + x9.45 + x9.46 + x9.47
X10a=~ x10a.48 + x10a.49 + x10a.50 + x10a.51 + x10a.52 + x10a.53
X10b=~ x10b.54 + x10b.55 + x10b.56 + x10b.57 + x10b.58 + x10b.59
X11=~ x11.60 + x11.61 + x11.62 + x11.63 + x11.64 + x11.65 + x11.66 + x11.67 + x11.68 + x11.69 + x11.70 + x11.71
X12=~ x12.72 + x12.73 + x12.74 + x12.75 + x12.76 + x12.77
y=~ y78 + y79 + y80 + y81 + y82


X3xX5 =~ x3.20.x5.28 + x3.21.x5.29 + x3.22.x5.30 + x3.23.x5.31_32_33

X4xX5 =~ x4.24.x5.28 + x4.25.x5.29 + x4.26.x5.30 + x4.27.x5.31_32_33 

X6xX7=~ x6.34.x7.38 + x6.35.x7.39 + x6.36.x7.40 + x6.37.x7.41_42

X10axX12 =~ x10a.48.x12.72 + x10a.49.x12.73 + x10a.50.x12.74 + x10a.51.x12.75 + x10a.52.x12.76 + x10a.53.x12.77

X10bxX12 =~ x10b.54.x12.72 + x10b.55.x12.73 + x10b.56.x12.74 + x10b.57.x12.75 + x10b.58.x12.76 + x10b.59.x12.77

 
X1 ~ a*X0
X2 ~ b*X1
X3 ~ c*X2
X4 ~ d*X2
X7 ~ i*X8
X9 ~ z*X8

y ~ s*X3 + f*X4 + g*X7 + l*X9 + n*X10a + t*X10b + o*X11 + e*X3xX5 + q*X4xX5 + h*X6xX7 + m*X10axX12 + p*X10bxX12


abce:= a*b*c*e
abdq:= a*b*d*q
ih:= i*h
"


Do you think my approach could be correct?

Terrence Jorgensen

unread,
Jun 17, 2019, 5:33:48 PM6/17/19
to lavaan

Do you think my approach could be correct?

According to what criteria?  You haven't told use what you want to test.  Try using the semPlot package's semPaths() function to generate a path diagram of your model, so you can check whether the model looks like you expect.  Indirect effects from a predictor to an outcome via a third variable is simply a matter of checking whether you are multiplying the paths you expect.

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

Reply all
Reply to author
Forward
0 new messages