Error in path analysis with 4 variables

11 views
Skip to first unread message

Thang Le

unread,
Nov 10, 2019, 3:39:27 PM11/10/19
to lavaan
Hi,

I am conducting a path analysis with 4 variables. The schematic can be seen below:

path_model.png














I'm interested in both the direct and indirect effects. I created the following syntax for the effects of PAG on AUDIT

active.model<-'
PSP ~ p1*PAG + mOFC

AUDIT ~ p2*PAG + p3*mOFC + p5*PSP

total := p1 + p2*p5 + p3*p5
indirect := p2*p5 + p3*p5  
'


active
.res<-sem(active.model, data=Data)
summary
(active.res)


I could do the same thing for the effects of mOFC but I don't know how to incorporate both PAG and mOFC in the same model. I tried:

active.model<-'
PSP ~ p1*PAG + mOFC
PSP ~ p4*mOFC + PAG


AUDIT ~ p2*PAG + p3*mOFC + p5*PSP


total := p1 + p4 + p2*p5 + p3*p5
indirect := p2*p5 + p3*p5  
'



active
.res<-sem(active.model, data=Data)
summary
(active.res)


This, rather obviously, produces an error of duplicate model element for PSP. Could anyone help? Thank you so much!

Thang Le

unread,
Nov 11, 2019, 8:44:21 AM11/11/19
to lavaan
Never mind. I figured it out. Thanks to the those who created the forum and keep it active anyway!

PSP ~ p1*PAG + p4*mOFC

Reply all
Reply to author
Forward
0 new messages