Abstract

Mediation analysis is routinely adopted by researchers from a wide range of applied disciplines as a statistical tool to disentangle the causal pathways by which an exposure or treatment affects an outcome. The counterfactual framework provides a language for clearly defining path-specific effects of interest and has fostered a principled extension of mediation analysis beyond the context of linear models. This paper describes medflex, an R package that implements some recent developments in mediation analysis embedded within the counterfactual framework. The medflex package offers a set of ready-made functions for fitting natural effect models, a novel class of causal models which directly parameterize the path-specific effects of interest, thereby adding flexibility to existing software packages for mediation analysis, in particular with respect to hypothesis testing and parsimony. In this paper, we give a comprehensive overview of the functionalities of the medflex package.

Highlights

  • Empirical studies often aim at gaining insight into the underlying mechanisms by which an exposure or treatment affects an outcome of interest

  • Its initial formulations were restricted to the context of linear regression models, several attempts have been made to extend the application of traditional estimators for indirect effects beyond linear settings (e.g., MacKinnon and Dwyer 1993; MacKinnon, Lockwood, Brown, Wang, and Hoffman 2007; Hayes and Preacher 2010; Iacobucci 2012)

  • In Appendix A.2, we demonstrate the link between the mediation formula and the imputation-based approach by showing how the former can be rewritten as an expression that prescribes estimating nested counterfactuals by calculating the mean of imputed nested counterfactuals, conditional on x, x∗ and C

Read more

Summary

Introduction

Empirical studies often aim at gaining insight into the underlying mechanisms by which an exposure or treatment affects an outcome of interest. Recent advances from the causal inference literature (e.g., Albert 2008; Albert and Nelson 2011; Avin, Shpitser, and Pearl 2005; Imai, Keele, and Yamamoto 2010b; Pearl 2001, 2012; Robins and Greenland 1992; VanderWeele and Vansteelandt 2009, 2010) have furthered these developments and improved both inference and interpretability of direct and indirect effect estimates in nonlinear settings by building on the central notion of counterfactual or potential outcomes. We conclude with some final remarks and list some extensions of the package which are planned to be implemented in the near future (Section 10)

Counterfactual outcomes and effect decomposition
The mediation formula
Applying the mediation formula in practice
Mediation analysis via natural effect models
Fitting natural effect models
F H 43 0
Weighting-based approach
Imputation-based approach
Dealing with different types of variables
Multicategorical exposures
Continuous exposures
Exposure-mediator interactions
Effect modification by baseline covariates
Tools for calculating and visualizing causal effect estimates
Linear combinations of parameter estimates
Effect decomposition
Global hypothesis tests
Visualizing effect estimates and their uncertainty
Population-average natural effects
Intermediate confounding: A joint mediation approach
Weighting or imputing?
Modeling demands
Missing data
10. Concluding remarks
Link between estimators and the mediation formula
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call