plotting the mediation model

Posted on
No user picture. Tooglad Joined: 05/14/2024

Dear Prof Cheung,

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

Replied on Sat, 09/21/2024 - 02:07
Picture of user. Mike Cheung Joined: 10/08/2009

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

 

Replied on Mon, 09/23/2024 - 22:50
Picture of user. Mike Cheung Joined: 10/08/2009

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

Replied on Tue, 05/27/2025 - 07:34
No user picture. Tooglad Joined: 05/14/2024

In reply to by Mike Cheung

Dear Prof Mike, 

I am wondering if you could explain to me what the numbers in the circle represent in the attached figure reported in Schutte, Keng, & Cheung (2021) - Mindfulness (1.00), Emotional intelligence (0.84), and Gratitude (0.89). 

Thank you so much.

Regards,

Tooglad 

File attachments
Replied on Tue, 06/03/2025 - 10:46
Picture of user. AdminNeale Joined: 03/01/2013

In reply to by Tooglad

The double-headed arrows (that are almost circles) are the estimated residual variances of each variable.  It appears that the data have been standardized, as the expected total variances seem all to be 1.0.  In the case of mindfulness, it's just 1.0 because it's not getting variance from anywhere else (i.e., there are no single-headed arrows pointing at it).

Please note that simple mediational models such as this have come in for heavy criticism in recent years, because they are sensitive to the test-retest reliabilities of the measures.  Unequal reliabilities can substantially bias the parameter estimates.  See Maxwell et al for more information https://pubmed.ncbi.nlm.nih.gov/26736047/ .  If you have some test-retest/longitudinal data on these metrics, they could clarify your analysis by removing bias.