plotting the mediation model
Attachment | Size |
---|---|
The sample plot from Schutte, Keng, & Cheung (2021) | 38.09 KB |
my plot | 6.48 KB |
I am currently working on a research project that involves implementing a two-step structural equation model. My question is whether anxiety mediates the relationship between mindfulness and meaning. However, the code for plotting the mediation model is not displaying the mediator variable in the right box. Below is the code I tried:
# Proposed model
model <- "Meaning ~ c*Anxiety + b*Mindfulness
Mindfulness ~ a*Anxiety
Anxiety ~~ 1*Anxiety"
plot(model, color="yellow")
RAM1 <- lavaan2RAM(model, obs.variables = varlist)
RAM1
stage2 <- tssem2(stage1, RAM=RAM1, intervals.type = "LB",
mx.algebras = list(Indirect=mxAlgebra(a*b, name="Indirect"),
Direct=mxAlgebra(c, name="Direct")))
summary(stage2)
plot(stage2, color="yellow")
My understanding is that the trianglular plot shows the mediating variable at the top (between the IV and DV), but this is not the case when I implement the above code. Instead, the plot shows the IV at the top, and mediator on the right, and the DV on the left. Ideally, I want the IV (Anxiety) on the left, the mediator (mindfulness) on the top, and the DV (meaning) on the right. Is there anything I’m not doing right? I have attached the plots from one of your papers (Schutte, Keng, & Cheung, 2021), which show the mediator ‘emotional intelligence’ at the top. However, this doesn’t appear to be the case when I tried to create a similar plot using the same code (see my plot attached). Any assistance would be greatly appreciated.
Thank you,
Tooglad
Hi Tooglad, Since I cannot…
Hi Tooglad,
Since I cannot find the attached figures, I can only guess that both figures are correct but with different arrangements.
haveThere is more than one way to arrange the plots. I don't know if the semPlot package can fix the arrangement.
Best,
Mike
Log in or register to post comments
In reply to Hi Tooglad, Since I cannot… by Mike Cheung
myplot and sample plot from Schutte, Keng, & Cheung (2021)
Hi Mike,
See my plot and plot from Schutte, Keng, & Cheung (2021).
Thanks,
Tooglad
Log in or register to post comments
In reply to Hi Tooglad, Since I cannot… by Mike Cheung
Hi Mike, I have resent the…
Hi Mike, I have resent the figures. Do you have an example code from semPlot package I can use to get the right plot?
Thanks,
Tooglad
Log in or register to post comments
In reply to Hi Tooglad, Since I cannot… by Mike Cheung
Hi Mike, Sorry, I can't fix…
Hi Mike,
Sorry, I can't fix the arrangement using semPlot. Any advise will be greatly appreciated.
Thanks,
Tooglad
Log in or register to post comments
Hi Tooglad, Both of them are…
Hi Tooglad,
Both of them are correct. The figure reported in Schutte, Keng, & Cheung (2021) was generated from Graphviz using the dot language.
If you do not like the figures generated by semPlot, please feel free to use other programs to do it.
Mike
Log in or register to post comments