This R package runs flexible mediation analyses using natural effect models, as introduced in
Lange, T., Vansteelandt, S., & Bekaert, M. (2012). A Simple Unified Approach for Estimating Natural Direct and Indirect Effects. American Journal of Epidemiology, 176(3), 190-195. doi:10.1093/aje/kwr525
Vansteelandt, S., Bekaert, M., & Lange, T. (2012). Imputation Strategies for the Estimation of Natural Direct and Indirect Effects. Epidemiologic Methods, 1(1), Article 7. doi:10.1515/2161-962X.1014
Loeys, T., Moerkerke, B., De Smet, O., Buysse, A., Steen, J., & Vansteelandt, S. (2013). Flexible Mediation Analysis in the Presence of Nonlinear Relations: Beyond the Mediation Formula. Multivariate Behavioral Research, 48(6), 871-894. doi:10.1080/00273171.2013.832132
To install the CRAN release version:
install.packages('medflex')
To install the latest development release (requires devtools
installation):
devtools::install_github('jmpsteen/medflex')
If you're using this package, please cite our companion paper in Journal of Statistical Software (which is also available as a vignette to the package)
Steen, J., Loeys, T., Moerkerke, B., & Vansteelandt, S. (2017). medflex: An R Package for Flexible Mediation Analysis Using Natural Effect Models. Journal of Statistical Software, 76(11). doi:10.18637/jss.v076.i11