I am interested in the mediated relation X -> M -> Y. I tested this relation using SEM. Following the literature on mediation analysis (Preacher and Hayes, 2008; Zhao et al., 2010 see the references below), and given the relatively small sample I have, I used bootstrap to test it. The code I used is very similar to the one below:
Figure 1 - Model
Code:
capture program drop test program test, rclass sem (Y <- M Msq X) (M <- X XE) * Mediated effect with moderator return scalar ME_M = _b[M:X]*_b[Y:M] + _b[M:X]*_b[Y:Msq] + _b[M:XE]*_b[Y:M] + _b[M:XE]*_b[Y:Msq] * Mediated effects without moderator return scalar ME_NM = _b[M:X]*_b[Y:M] + _b[M:X]*_b[Y:Msq] end bootstrap r(ME_M) r(ME_NM) reps(5000) seed(1) nodots: test
Figure 2 - Plot mediated relation
I would be really grateful if anyone could help me accomplish this. …and perhaps suggest other tests that might be relevant to explore the shape of the mediated relation and how the mediated relation changes as a function of the moderator.
Many thanks,
Riccardo
References
Preacher, K. J., & Hayes, A. F. (2004). SPSS and SAS procedures for estimating indirect effects in simple mediation models. Behavior research methods, instruments, & computers, 36(4), 717-731.
Zhao, X., Lynch Jr, J. G., & Chen, Q. (2010). Reconsidering Baron and Kenny: Myths and truths about mediation analysis. Journal of consumer research, 37(2), 197-206.
0 Response to Plotting a (curvilinear) mediated relation
Post a Comment