Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Plotting a (curvilinear) mediated relation

    I am working with a mediated-moderated model like that in Fig. 1. All variables in the model are continuous. The relations depicted by the dashed and solid lines were found to be statistically significant in separate regressions (i.e. reg Y M c.M#c.M X / reg M X c.X#c.E)

    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:
    Click image for larger version

Name:	framework2.jpg
Views:	1
Size:	11.9 KB
ID:	1515460

    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
    At this point, after testing the existence of the mediated relation, I would like to plot it using marginsplot. And that’s where I have troubles. The reason I would like to plot this relation is to show that also the mediated relation (X -> M -> Y) is curvilinear, as is the relation between M -> Y. Since the latter relation (M -> Y) is a component of the mediated relation, I suspect (but I am not fully sure), that the whole mediated relation (X -> M -> Y) is itself curvilinear. Not only would I like to draw this relation, but I would also like to draw it at two different levels of the moderator E (i.e. E’ and E’’), as shown in Fig. 2. However, I would like to do so without imposing levels of the mediator (M) – that is, I would like the mediator to take values it really takes in the sample (I hope it’s clear what I mean with this last statement). To complicate things further, if I want to plot CIs I may need to obtain them using some kind of boostrap procedure to be coherent with the rest of the analysis. And that’s where I get lost.
    Click image for larger version

Name:	plot.png
Views:	1
Size:	6.3 KB
ID:	1515461

    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.

  • #2
    In practice, what I am trying to accomplish is similar to what Hayes & Preacher (2010) do in the following article with a routine that works on MPlus, SAS, and SPSS

    Hayes, A. F., & Preacher, K. J. (2010). Quantifying and testing indirect effects in simple mediation models when the constituent paths are nonlinear. Multivariate behavioral research, 45(4), 627-660.

    The difference is that to complicate things I also have a moderating variable (E) in the first part of the model. What they do is also slightly different with respect to what my question is about: while I would like to plot marginal effects, they seem to be obtaining AMEs at different points in the distribution of the variable in the quadratic relation (which in my case is M -> Y).

    It would be greatly helpful if someone knew if I can accomplish the same thing in Stata.

    Many thanks
    Last edited by Riccardo Valboni; 09 Sep 2019, 05:09.

    Comment

    Working...
    X