I am currently trying to investigate how mediation analysis can be applied with longitudinal data. I already considered some Structural Equation Models (SEM), e.g. the 3-Wave example of MacKinnonn(2008).

However, after considering VanderWeele's (2015) book "Mediation". I am more interesseted in using IPW approach (Inverse-Probabilty Weights) and Marginal Structural Models (MSM). After calculating the seperate weights:

enter image description here


enter image description here enter image description here

as recommended by VanderWeele (2015:156-157), I wanted to fit the final (response) model(s). The aim is to recieve the indirect, direct & controlled direct effect with the weights applied. Yet, after considering VanderWeele's instructions, it is unclear to me how to estimate the indirect and direct effect correctly. In chapter 5 & 6.3 he describes/recommends a "Randomized Interventional Analogues", which is, to my knowledge, not implemented yet in any statistical software or extension.

Therefore I want to ask if "standard"- procederes to mediation (e.g. Baron-Kenny or even SEM) can be extended with IPW? - Thus the indirect & direct effect are still correctly obtainable?

To be more specific I use stata and calculated the IPW as described by VanderWeele. After that I want to fit the final (response) model with the ado "medeff" by Hicks & Tingly (2011) using the IPW weights, to obtain the indirect and direct effect. "medeff" ado's estimation for (in)direct effects is based on Imai et al. (2010) monte-carlo procedere.

I am looking forward to recieve some answers or further recommendations. Thanks in advance


Imai, Kosuke, Luke Keele and Dustin Tingley (2010) A General Approach to Causal Mediation Analysis, Psychological Methods 15(4) pp. 309-334.

MacKinnon, D. P. (2008). Introduction to Statistical Mediation Analysis. New York:Erlbaum.

VanderWeele, T. J. (2015). Explanation in causal inference: methods for mediation and interaction. Oxford University Press.

If you cant get a copy of the Book the procedere is also described in:

VanderWeele, T. J., & Tchetgen Tchetgen, E. J. (2017). Mediation analysis with time varying exposures and mediators. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(3), 917-938.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.