Mediation refers to the effect transmitted by mediators that intervene in the relationship between an exposure and a response variable. Mediation analysis has been broadly studied in many fields. However, it remains a challenge for researchers to consider complicated associations among variables and to differentiate individual effects from multiple mediators.  proposed general definitions of mediation effects that were adaptable to all different types of response (categorical or continuous), exposure, or mediation variables. With these definitions, multiple mediators of different types can be considered simultaneously, and the indirect effects carried by individual mediators can be separated from the total effect. Moreover, the derived mediation analysis can be performed with general predictive models. That is, the relationships among variables can be modeled using not only generalized linear models but also nonparametric models such as the Multiple Additive Regression Trees. Therefore, more complicated variable transformations and interactions can be considered in analyzing the mediation effects. The proposed method is realized by the R package mma. We illustrate in this paper the proposed method and how to use mma to estimate mediation effects and make inferences.
Yu, Q., & Li, B. (2017). mma: An R Package for Mediation Analysis with Multiple Mediators. Journal of Open Research Software, 5. https://doi.org/10.5334/jors.160