Valeri and VanderWeele (1) and VanderWeele and Vansteelandt (2) used the counterfactual framework to extend classical formulas from Baron and Kenny (3) to account for exposure-mediator interaction in mediation analysis. VanderWeele and Vansteelandt also extended the results to the case where the outcome is binary (2). VanderWeele and Tchetgen Tchetgen (4) identified the randomized interventional analogs of the natural direct and indirect effects in longitudinal settings in the presence of time-varying exposure, a time-varying mediator, and possibly time-varying confounders and gave marginal structural modeling approaches for use when the outcome is continuous. We synthesized the ideas in these 2 papers to derive expressions for randomized interventional analogs of natural direct and indirect effects with exposure-mediator interaction when the outcome is binary but the exposure, mediator, and potential confounders are time-varying. We thereby extend the marginal structural model (MSM) approach of VanderWeele and Tchetgen Tchetgen for continuous outcomes (4) to the setting of binary outcomes.
Let Y denote the binary outcome, A(t) denote the exposure measured at time t, M(t) denote the mediator at time t, L(t) denote the set of potentially time-varying confounders at time t, and V denote the set of time-invariant baseline covariates for t = 1, . . ., T. Let and , and let and The corresponding lowercase letters refer to the observed realizations of the random variates. With initial baseline covariates V and subsequent temporally ordered set {A(t), L(t), M(t)}, the relationships among A(t), L(t), M(t), Y, and V can be represented via the causal diagram in panel A of Figure 1.
Figure 1.
Causal diagram of time-varying mediation with the ordering of exposure measured at time t (A(t)), a time-varying confounder measured at time t (L(t)), and a mediator measured at time t (M (t)) (A) and causal diagram of time-varying exposures A(t) and mediators M (t) with no time-varying confounders L(t) (B). V is the set of time-invariant covariates, and Y is the outcome.
Let denote the value of the potential outcome that would have been observed if exposure were set to level and the mediator were set to level Let be the counterfactual value of M(t) if were set to The natural direct and indirect effects are often of great interest in evaluating various mechanisms in decision-making. Comparing exposure levels and the natural direct effect conditional on covariates V = v is defined as the change in outcome if the exposure changes from level to and the mediator is kept at the level at which it would have naturally been, namely The natural indirect effect can be defined as the change in outcome if the exposure were fixed at and the mediator were changed from to Unfortunately, in settings like Figure 1A in which there is a variable L(1) that is affected by the exposure and confounds the relationship between the mediator and the outcome, natural direct and indirect effects are not identified (5). Instead we consider randomized interventional analogs of these effects, following the work of VanderWeele and Tchetgen Tchetgen (4). We denote as the corresponding randomly drawn counterfactuals from the distribution of the mediator that would have been observed if exposure had been fixed to given V = v. Conditional on V = v, the randomized interventional analogs of the natural direct effect (DE) and the natural indirect effect (IE) on the log odds ratio (OR) scale with exposure level changed from to are defined as
The following 3 no-unmeasured-confounding assumptions suffice to identify DE and IE: 1) the effect of the exposure on the outcome is unconfounded, conditional on baseline covariates and the past (including past exposures, past mediators, and past confounders); 2) the effect of the mediator on the outcome is unconfounded, conditional on baseline covariates and the past; and 3) the effect of the exposure on the mediator is unconfounded, conditional on baseline covariates and the past. See Web Appendix 1 (available at http://aje.oxfordjournals.org/) for mathematical statements of these assumptions. If the assumptions hold, DE and IE can be evaluated using the following pair of MSMs. We assume that the logistic regression MSM for the counterfactual binary outcome (6) is given by
where and Under assumptions 1 and 2 above, consistent estimates of the MSM coefficients can be obtained by fitting the logistic regression model with observed data
with stabilized inverse probability weights (6):
where f(.) is the likelihood function under a standard parametric model. Assume that the linear repeated-measures MSMs (7) for the counterfactual mediator process are given by
where for t = 1, 2, …, T. Likewise, under assumption 3 above, consistent coefficient estimates can be obtained by fitting the regression models with observed data
with stabilized inverse probability weights (6):
for t = 1, …, T.
Under the assumption that the outcome is rare, we can obtain the expressions for DE and IE in terms of the coefficients estimated from the above regressions. If we further assume that the in the above T linear repeated-measures MSMs are multivariate normally distributed, we can derive that
where and Σ is the variance-covariance matrix of the error terms from the MSMs. The DE and IE can subsequently be obtained. We show in Web Appendix 2 that the DE log odds ratio and the IE log odds ratio with exposure changed from to can be expressed by
If we follow the convention that exposure and mediator are centered at the mean value for better interpretability on interactions and express the mediation effects in terms of a 1-unit increase from −1 to 0 (a*(t) = −1 and a(t) = 0 for all t), the DE log odds ratio and IE log odds ratio can be further simplified as
The derivations are provided in Web Appendix 2. With T = 1, these expressions identically match the expressions presented by Valeri and VanderWeele (1) for a study with a single exposure, mediator, and outcome. A standard vanilla bootstrap implemented by resampling subjects with replacement, with their available set of individual measurements—including longitudinal exposure, longitudinal mediator, other covariates, and the corresponding binary outcome—can be used to obtain bootstrap standard errors and confidence intervals.
If we consider L(t) to be an empty set, the causal diagram can be modified as in panel B of Figure 1. Under the relationships described above, the inverse probability weighting in MSMs for L can be dropped, and thus the observed data models can be fitted without the weights to consistently estimate the parameters of the MSMs. See Ferguson et al. (8) for an application.
Supplementary Material
Acknowledgments
Funding for this project was provided by the National Institute of Environmental Health Sciences (grants ES017876 and ES020811) and the Division of Mathematical Sciences of the National Science Foundation (DMS grant 1007494).
Conflict of interest: none declared.
References
- 1.Valeri L, VanderWeele TJ. Mediation analysis allowing for exposure-mediator interactions and causal interpretation: theoretical assumptions and implementation with SAS and SPSS macros. Psychol Methods. 2013;182:137–150. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.VanderWeele TJ, Vansteelandt S. Odds ratios for mediation analysis for a dichotomous outcome. Am J Epidemiol. 2010;17212:1339–1348. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Baron RM, Kenny DA. The moderator-mediator variable distinction in social psychological research: conceptual, strategic, and statistical considerations. J Pers Soc Psychol. 1986;516:1173–1182. [DOI] [PubMed] [Google Scholar]
- 4.VanderWeele TJ, Tchetgen Tchetgen E. Mediation analysis with time-varying exposures and mediators. Cambridge, MA: Harvard University; 2014. (Harvard University Biostatistics Working Paper Series, Working Paper 168). http://biostats.bepress.com/harvardbiostat/paper168. Accessed March 4, 2014. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Avin C, Shpitser I, Pearl J. Identifiability of Path-Specific Effects. Los Angeles, CA: Department of Statistics, University of California, Los Angeles; 2005. [Google Scholar]
- 6.Robins JM, Hernán MA, Brumback B. Marginal structural models and causal inference in epidemiology. Epidemiology. 2000;115:550–560. [DOI] [PubMed] [Google Scholar]
- 7.Hernán MA, Brumback BA, Robins JM. Estimating the causal effect of zidovudine on CD4 count with a marginal structural model for repeated measures. Stat Med. 2002;2112:1689–1709. [DOI] [PubMed] [Google Scholar]
- 8.Ferguson KK, Chen Y-H, VanderWeele TJ et al. Mediation of the relationship between maternal phthalate exposure and preterm birth by oxidative stress with repeated measurements across pregnancy. Environ Health Perspect. 2016. (in press). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.

