Announcement

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

  • Mediation analysis with multiple mediators

    Dear Statalists,

    I am interested in performing causal mediation analysis as separable effects to investigate causal mechanisms of a binary exposure on a continuous outcome. We have six mediators.
    The problem is that mediate, paramed, and medeff only allow single mediators and we want to fit six.
    Are there any packages that allow multiple mediators or anyone with experience using the above commands to work with multiple mediators?

    We could fit separate models for each mediator and sum each natural indirect effect (NIE), but would like to take into account potential mediators that affect one another, eg. by including all mediators in the outcome model somehow.
    I have looked into using nlcom for summing each NIE after mediate (assuming no mediator-mediator interaction). I am however not sure how to refer to coefficient labels across six separate mediation models in a single nlcom command? Also, the natural direct effects (NDE) are slightly different in each model, making it confusing for how to sum this NDE with each NIE (x6) to obtain the total effect.

    I don't know if this helps but here is a snippet of the mediate command with nlcom to calculate the total effect from the sum of indirect and direct effects in a single model:
    Code:
    mediate (outcomevar outcomevar_baseline covariate1, linear) (mediator1 mediator1_baseline covariate2, linear) (exposure_allocation), control(0) aeq all 
    nlcom _b[NDE:r1vs0.exposure_allocation]+_b[NIE:r1vs0.exposure_allocation]
    Thank you for your help.

    Kind regards,
    Wei

  • #2
    -sem- and -gsem- allow multiple mediators; you may find it easiest to start with the builder (found via dialogue boxes) which will automatically write the code for you and show you want it is; note that if you use -gsem- you have to calculate the indirect effects yourself; there is an example in the manual on use -nlcom- for this (example 42g)

    Comment


    • #3
      Thank you for the suggestion and the example reference. I will look into building the model myself. Was hoping that I somehow had missed an existing option or a package that could handle multiple mediators natively.
      Do you know of a "best practice" when pulling coefficients from multiple models? Using coefficient labels in nlcom only refers to the latest model. Would it work the same if I stored coefficients as scalars or even the whole output table as a matrix and refer to each coefficient[y,x] in the matrix within nlcom?

      Comment


      • #4
        Causal mediation with flexible models that allow for treatment-mediator as well as mediator-mediator interactions aren't really feasible with more than two mediators because the number of unique treatment effect decompositions into direct and indirect effects grows at an insane rate with the number of mediators. For k causally ordered mediators, and underlying models that include treatment-mediator as well as mediator-mediator interactions, the number of unique decompositions is the factorial of 2^k (see [1]). With six mediators, that would amount to around 10^89 which is roughly 10^65 times the number of stars in the observable universe, or around 50 million times the estimated number of atoms in the observable universe. Causal mediation with more than two mediators is only really feasible when using restrictive models that don't allow for any interactions, in which case there is always just a single decomposition into direct/indirect effects. If the outcome and all mediators are continuous (or can be reasonably modeled as though they were) then SEM is a viable avenue and you could use Stata's sem command. If you wanted to include models other than linear models, gsem wouldn't be of much help because it wouldn't know how to combine the results from the individual equations to get the treatment effects of interest (i.e., multiplying path coefficients only works with linear models).

        As for mediate and doing one mediator at a time, this can be done. However, this is only a valid strategy if there is no correlation of any kind among the mediators, which does not seem to be true in your case.

        Reference:
        [1]: Daniel, Rhian M., Bianca L. De Stavola, Simon N. Cousens, and Stijn Vansteelandt. "Causal mediation analysis with multiple mediators." Biometrics 71, no. 1 (2015): 1-14.

        Comment


        • #5
          Thank you for your valuable feedback Joerg. I'll take them into consideration moving forward. I will be fitting my own causal mediation model with the sem command partially assisted by the methods suggested by VanderWeele and Vansteelandt in this paper:
          VanderWeele, T.J., and S. Vansteelandt. 2014. “Mediation Analysis with Multiple Mediators.” Epidemiologic Methods 2 (1): 95–115. https://doi.org/10.1515/em-2012-0010.

          I will have to be careful with my assumptions when designing the DAG.

          Comment

          Working...
          X