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:
Thank you for your help.
Kind regards,
Wei
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]
Kind regards,
Wei
Comment