Skip to main content
American Journal of Epidemiology logoLink to American Journal of Epidemiology
letter
. 2016 Jun 19;184(2):157–159. doi: 10.1093/aje/kww045

Mediation Formula for a Binary Outcome and a Time-Varying Exposure and Mediator, Accounting for Possible Exposure-Mediator Interaction

Yin-Hsiu Chen 1, Bhramar Mukherjee 1, Kelly K Ferguson 2, John D Meeker 2, Tyler J VanderWeele 3
PMCID: PMC4945703  PMID: 27325886

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 A¯(t)=(A(1),...,A(t)), M¯(t)=(M(1),...,M(t)), and L¯(t)=(L(1),...,L(t)), and let A¯A¯(T), M¯M¯(T), and L¯L¯(T). 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.

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 Ya¯m¯ denote the value of the potential outcome that would have been observed if exposure were set to level a¯ and the mediator were set to level m¯. Let Ma¯(t) be the counterfactual value of M(t) if A¯ were set to a¯. The natural direct and indirect effects are often of great interest in evaluating various mechanisms in decision-making. Comparing exposure levels a¯ and a¯, the natural direct effect conditional on covariates V = v is defined as the change in outcome if the exposure changes from level a¯ to a¯ and the mediator is kept at the level at which it would have naturally been, namely M¯a¯. The natural indirect effect can be defined as the change in outcome if the exposure were fixed at a¯ and the mediator were changed from M¯a¯ to M¯a¯. 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 G¯a¯|v(t) as the corresponding randomly drawn counterfactuals from the distribution of the mediator M¯(t) that would have been observed if exposure had been fixed to a¯ 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 a¯ to a¯ are defined as

log(ORDE)=logit[P(Ya¯G¯a¯|v=1|v)]logit[P(Ya¯G¯a¯|v=1|v)].
log(ORIE)=logit[P(Ya¯G¯a¯|v=1|v)]logit[P(Ya¯G¯a¯|v=1|v)].

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

logit[P(Ya¯m¯=1|v)]=βy0+βyacum(a¯)+βymcum(m¯)+βyicum(a¯)cum(m¯)+βyvv,

where cum(a¯)=t=1Ta(t) and cum(m¯)=t=1Tm(t). Under assumptions 1 and 2 above, consistent estimates of the MSM coefficients can be obtained by fitting the logistic regression model with observed data

logit[P(Y=1|A¯=a¯,M¯=m¯,v)]=βy0+βyacum(a¯)+βymcum(m¯)+βyicum(a¯)cum(m¯)+βyvv

with stabilized inverse probability weights (6):

t=1Tf[M(t)|A¯(t),M¯(t1),V]f[M(t)|A¯(t),M¯(t1),L¯(t1),V]×f[A(t)|A¯(t1),M¯(t1),V]f[A(t)|A¯(t1),M¯(t1),L¯(t1),V],

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

E[Ma¯(t)|v]=βm0(t)+βma(t)avg(a¯(t))+βmv(t)v,

where avg(a¯(t))=s=1ta(s)/t for t = 1, 2, …, T. Likewise, under assumption 3 above, consistent coefficient estimates can be obtained by fitting the regression models with observed data

E[M(t)|A¯(t)=a¯(t),v]=βm0(t)+βma(t)avg(a¯(t))+βmv(t)v

with stabilized inverse probability weights (6):

s=1tf[A(s)|A¯(s1),M¯(s1),V]f[A(s)|A¯(s1),M¯(s1),L¯(s1),V]

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 Ma¯(t) in the above T linear repeated-measures MSMs are multivariate normally distributed, we can derive that

cum(M¯a¯)|vNt=1T[βm0(t)+βma(t)avg(a¯(t))+βmv(t)v],σ2,

where cum(M¯a¯)=t=1TMa¯(t), σ2=1TΣ1, 1T×1=(1,1,...,1)T, 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 a¯ to a¯ can be expressed by

log(ORDE)=[cum(a¯)cum(a¯)]{βya+βyi{t=1T[βm0(t)+βma(t)avg(a¯(t))+βmv(t)v]+σ2βym}}+12σ2βyi2[cum(a¯)2cum(a¯)2].
log(ORIE)=t=1T[βym+βyicum(a¯)]βma(t)[avg(a¯(t))avg(a¯(t))].

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

log(ORDE)=T{βya+{βyit=1T[βm0(t)βma(t)+βmv(t)v]+σ2βym}}T22σ2βyi2.
log(ORIE)=βymt=1Tβma(t).

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

Web 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.

Supplementary Materials

Web Material

Articles from American Journal of Epidemiology are provided here courtesy of Oxford University Press

RESOURCES