Chapter 27 Mediation Analysis: Natural Direct and Indirect Effects

With an intermediate variable M between the treatment Z and outcome Y, the causal effects within principal strata defined by U=\{M(1),M(0)\} can assess the treatment effect heterogeneity across latent groups U. When M is indeed on the causal pathway from Z to Y, causal effects within some principal strata, \tau(1,1) and \tau(0,0), can give information about the direct effect of Z on Y. However, these direct effects are only for two latent groups. The causal effects within the other two principal strata, \tau(1,0) and \tau(0,1), contain both direct and indirect effects. Fundamentally, principal stratification does not provide any information about the indirect effect of Z on Y through M because it does not even assume that M can be intervened.

In the above discussion, I use the notions of “direct effect” and “indirect effect” in a casual way. When M lies on the pathway from Z to Y, researchers often want to assess the extent to which the effect of Z on Y is through M and the extent to which the effect is through other pathways. This is called mediation analysis. It is the topic of this chapter.

139 Motivating Examples

In mediation analysis, we have a treatment Z, an outcome Y, a mediator M, and some background covariates X. Figure 43 illustrates their relationship. Below we give some concrete examples.

\textstyle{X\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\textstyle{Z\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\textstyle{M\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\textstyle{Y}
Figure 43: Causal diagram for mediation analysis
Example 27.1

VanderWeele et al., (2012) conducted mediation analysis to assess the extent to which the effect of variants on chromosome 15q25.1 on lung cancer is mediated through smoking and the extent to which it operates through other causal pathways53. The exposure levels correspond to changes from 0 to 2 C alleles, smoking intensity is measured by the square root of cigarettes per day, and the outcome is the lung cancer indicator. VanderWeele et al., (2012)’s study contained many sociodemographic covariates.

Example 27.2

Rudolph et al., (2018) studied the causal mechanism from neighborhood poverty to adolescent substance use, mediated by the school and peer environment. They used data from the National Comorbidity Survey Replication Adolescent Supplement, a nationally representative survey of U.S. adolescents conducted during 2001–2004. The treatment is the binary indicator of neighborhood disadvantage, defined as living in the lowest tertile of neighborhood socioeconomic status based on data from the 2000 U.S. Census. Four binary mediators are measures of school and peer environments, and six binary outcomes are measures of substance use. Baseline covariates included the adolescent’s sex, age, race, immigration generation, family income, etc.

Example 27.3

The mediation package in R contains a dataset called jobs, which is from JOBS II, a randomized field experiment that investigates the efficacy of a job training intervention on unemployed workers. We used this dataset in Chapter 107. The program is designed to not only increase reemployment among the unemployed but also enhance the mental health of the job seekers. It is therefore of interest to assess the indirect effect of the intervention on mental health through job search efficacy and its direct effect acting through other pathways. We will revisit this example in Chapter 142.2 later.

140 Nested Potential Outcomes

140.1 Natural Direct and Indirect Effects

Below we drop the index i for unit i and assume all random variables are IID draws from a superpopulation. For simplicity, we focus on a binary treatment Z.

We first consider the hypothetical intervention on z and define potential mediators and outcomes corresponding to the intervention on z:

\{M(z),Y(z):z=0,1\}.

We then consider hypothetical intervention on both z and m and define potential outcomes corresponding to the interventions on z and m:

\{Y(z,m):z=0,1;m\in\mathcal{M}\},

where \mathcal{M} contains all possible values of m. Robins and Greenland, (1992) and Pearl, (2001) further consider the nested potential outcomes corresponding to intervention on z and m=M(z^{\prime}):

\{Y(z,M_{z^{\prime}}):z=0,1;z^{\prime}=0,1\}

where I write M(z^{\prime}) as M_{z^{\prime}} to avoid excessive parentheses. The notation Y(z,M_{z^{\prime}}) is the hypothetical outcome if the treatment were set at level z and the mediator were set at its potential level M(z^{\prime}) under treatment z^{\prime}. Importantly, z and z^{\prime} can be different. With a binary treatment, we have four nested potential outcomes in total:

\{Y(1,M_{1}),Y(1,M_{0}),Y(0,M_{1}),Y(0,M_{0})\}.

The nested potential outcome Y(1,M_{1}) is the hypothetical outcome if the treatment were set at z=1 and the mediator were set at what would happen under z=1. Similarly, Y(0,M_{0}) is the outcome if the treatment were set at z=0 and the mediator were set at what would happen under z=0. It would be surprising if Y(1,M_{1})\neq Y(1) or Y(0,M_{0})\neq Y(0). Therefore, we make the following composition assumption throughout this chapter.

Assumption 27.1 (composition)

Y(z,M_{z})=Y(z) for z=0,1.

The composition assumption cannot be proved. It is indeed an assumption. Without causing philosophical debates, we can even define Y(1) as Y(1,M_{1}), and define Y(0) as Y(0,M_{0}). Then by definition, Assumption 27.1 holds.

The nested potential outcome Y(1,M_{0}) is the hypothetical outcome if the unit received treatment 1 but its mediator were set at its natural value M_{0} without the treatment. Similarly, Y(0,M_{1}) is the hypothetical outcome if the unit received control 0 but its mediator were set at its natural value M_{1} under the treatment. They are two cross-world counterfactual terms and are useful for defining the direct and indirect effects.

Definition 27.1 (total, direct and indirect effects)

Define the total effect of the treatment on the outcome as

\tau=E\{Y(1)-Y(0)\}.

Define the natural direct effect as

\textsc{nde}=E\{Y(1,M_{0})-Y(0,M_{0})\}.

Define the natural indirect effect as

\textsc{nie}=E\{Y(1,M_{1})-Y(1,M_{0})\}.

The total effect is the standard average causal effect of Z on Y. The natural direct effect measures the effect of the treatment on the outcome if the mediator were set at the natural value M_{0} without the intervention. The natural indirect effect measures the effect of the treatment through changing the mediator if the treatment itself were set at z=1. Under the composition assumption, the natural direct and indirect effects reduce to

\textsc{nde}=E\{Y(1,M_{0})-Y(0)\},\quad\textsc{nie}=E\{Y(1)-Y(1,M_{0})\},

and therefore, we can decompose the total effect as the sum of the natural direct and indirect effects.

Proposition 27.1

By Definition 27.1 and Assumption 27.1, we have

\tau=\textsc{nde}+\textsc{nie}.

Mathematically, we can also define the natural indirect effect as E\{Y(0,M_{1})-Y(0,M_{0})\} where the treatment is fixed at 0. However, this definition does not lead to the decomposition in Proposition 27.1.

Unfortunately, the nest potential outcome Y(1,M_{0}) is not an easy quantity to understand due to the cross-world nature of the interventions: the treatment is set at z=1 but the mediator is set at its natural value M_{0} under treatment z=0. Clearly, these two interventions on the treatment cannot simultaneously happen in any realized experiment. To understand the cross-world potential outcome Y(1,M_{0}), we need to imagine the existence of parallel worlds as shown in Figure 44. Let’s focus on Y(1,M_{0}). When the treatment is set at z=1, the mediator must take value M_{1}. If at the same time, we want to set the mediator at m=M_{0}, we must know the value of M_{0} for the same unit from another experiment in the parallel world. This can be an unrealistic physical experiment because it requires that the same unit is intervened at two different levels of the treatment. Under some strong assumptions about the homogeneity of units, we may use another unit’s mediator value under control as a proxy for M_{0}.

140.2 Metaphysics or Science

Causal inference is hard, and there is no agreement even on its mathematical notation. Robins and Greenland, (1992) and Pearl, (2001) used the nested potential outcomes to define the natural direct and indirect effects. However, Frangakis and Rubin, (2002) called Y(1,M_{0}) and Y(0,M_{1}) a priori counterfactuals because we can not observe them in any physical experiments. In this sense, they do not exist a priori. According to Popper, (1963), a way to distinguish science and metaphysics is the falsifiability of the statements. That is, if a statement is not falsifiable based on any physical experiments or observations, then it is not a scientific but rather a metaphysical statement. Because we can not observe Y(1,M_{0}) and Y(0,M_{1}) in any experiments, we can not falsify any statements involving them except for the trivial ones (e.g., some outcomes are binary, or continuous, or bounded). Therefore, a strict Popperian statistician would view mediation analysis as metaphysics.

More strikingly, Dawid, (2000) criticized the potential outcomes framework to be metaphysical, and he called Rubin’s “Science Table” defined in Chapter 7 a “metaphysical array.” This is a critique on not only the a priori counterfactuals Y(1,M_{0}) and Y(0,M_{1}) but also the simpler potential outcomes Y(1) and Y(0). Dawid, (2000) argued that because we can never observe Y(1) and Y(0) jointly, then introducing the notation \{Y(1),Y(0)\} is a metaphysical activity. He is correct about the metaphysical nature of the joint distribution of \textup{pr}\{Y(1),Y(0)\}, but he is incorrect about the marginal distributions. Based on the observed data, we indeed can falsify some statements about the marginal distributions, although we cannot falsify any statements about the joint distribution.54 Therefore, even according to Popper, (1963), Rubin’s Science Table is not metaphysical because it has some nontrivial falsifiable implications although not all implications are falsifiable. This is the fundamental difference between \{Y(1),Y(0)\} and \{Y(1,M_{0}),Y(0,M_{1})\}.

插图
Figure 44: Cross-world potential outcomes Y(1,M_{0}) and Y(0,M_{1})

141 The Mediation Formula

Pearl, (2001)’s mediation formula relies on the following four assumptions. The first three essentially assume that the treatment and the mediator are both randomized conditional on observed covariates.

Assumption 27.2

There is no treatment-outcome confounding:

Z\ind Y(z,m)\mid X

for all z and m.

Assumption 27.3

There is no mediator-outcome confounding:

M\ind Y(z,m)\mid(X,Z)

for all z and m.

Assumptions 27.2 and 27.3 together are often called sequential ignorability. They are equivalent to the assumption that (Z,M) are jointly randomized conditioning on X:

\displaystyle(Z,M)\ind Y(z,m)\mid X (138)

for all z and m. I leave the proof of (138) as Problem 27.2.

Assumption 27.4

There is no treatment-mediator confounding:

Z\ind M(z)\mid X

for all z.

The last assumption is the cross-world independence.

Assumption 27.5

There is no cross-world independence between the potential outcomes and potential mediators:

Y(z,m)\ind M(z^{\prime})\mid X

for all z,z^{\prime} and m.

Assumptions 27.2–27.4 are very strong, but at least they hold under experiments with randomized treatment and mediator. Assumption 27.5 is stronger because no physical experiment can ensure it. Because we can never observe Y(z,m) and M(z^{\prime}) in any experiment if z\neq z^{\prime}, Assumption 27.5 can never be validated so it is fundamentally metaphysical.

I give an example below in which Assumptions 27.2–27.5 all hold.

Example 27.4

Given X, we generate

\displaystyle Z \displaystyle= \displaystyle 1\{g_{Z}(X,\varepsilon_{Z})\geq 0\},
\displaystyle M(z) \displaystyle= \displaystyle 1\{g_{M}(X,z,\varepsilon_{M})\geq 0\},
\displaystyle Y(z,m) \displaystyle= \displaystyle g_{Y}(X,z,m,\varepsilon_{Y}),

for z,m=0,1, where \varepsilon_{Z},\varepsilon_{M},\varepsilon_{Y} are all independent random errors. Consequently, we generate the observed values of M and Y from

\displaystyle M \displaystyle= \displaystyle M(Z)=1\{g_{M}(X,Z,\varepsilon_{M})\geq 0\},
\displaystyle Y \displaystyle= \displaystyle Y(Z,M)=g_{Y}(X,Z,M,\varepsilon_{Y}).

We can verify that Assumptions 27.2–27.5 hold under this data-generating process. On the contrary, if we allow \varepsilon_{M} and \varepsilon_{Y} to be \varepsilon_{M}(z) and \varepsilon_{Y}(z,m), then Assumptions 27.2–27.5 can fail. See Problem 27.3 for more details.

Pearl, (2001) proved the following key result for mediation analysis.

Theorem 27.1

Under Assumptions 27.2–27.5, we have

E\{Y(z,M_{z^{\prime}})\mid X=x\}=\sum_{m}E(Y\mid Z=z,M=m,X=x)\textup{pr}(M=m\mid Z=z^{\prime},X=x)

and therefore,

\displaystyle E\{Y(z,M_{z^{\prime}})\}
\displaystyle= \displaystyle\sum_{x}E\{Y(z,M_{z^{\prime}})\mid X=x\}\textup{pr}(X=x)
\displaystyle= \displaystyle\sum_{x}\sum_{m}E(Y\mid Z=z,M=m,X=x)\textup{pr}(M=m\mid Z=z^{\prime},X=x)\textup{pr}(X=x).

Theorem 27.1 assumes that both M and X are discrete. With general M and X, the mediation formulas become

E\{Y(z,M_{z^{\prime}})\mid X=x\}=\int E(Y\mid Z=z,M=m,X=x)f(m\mid Z=z^{\prime},X=x)\textnormal{d}m

and

\displaystyle E\{Y(z,M_{z^{\prime}})\}
\displaystyle= \displaystyle\int E\{Y(z,M_{z^{\prime}})\mid X=x\}f(x)\textnormal{d}x
\displaystyle= \displaystyle\int\int E(Y\mid Z=z,M=m,X=x)f(m\mid Z=z^{\prime},X=x)f(x)\textnormal{d}m\textnormal{d}x.

From Theorem 27.1, the identification formulas for the means of the nested potential outcomes depend on the conditional mean of the outcome given the treatment, mediator, and covariates, as well as the conditional mean of the mediator given the treatment and covariates. We need to evaluate these two conditional means at different treatment levels if the nested potential outcome involves cross-world interventions.

If we drop the cross-world independence assumption, we can modify the definition of the natural direct and indirect effects and the same formulas hold. See Problem 27.11 for more details.

I give the proof below.

Proof of Theorem 27.1: By the tower property, E\{Y(z,M_{z^{\prime}})\}=E[E\{Y(z,M_{z^{\prime}})\mid X\}], so we need only to prove the formula for E\{Y(z,M_{z^{\prime}})\mid X=x\}. Starting with the law of total probability, we have

\displaystyle E\{Y(z,M_{z^{\prime}})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}E\{Y(z,M_{z^{\prime}})\mid M_{z^{\prime}}=m,X=x\}\textup{pr}(M_{z^{\prime}}=m\mid X=x)
\displaystyle= \displaystyle\sum_{m}E\{Y(z,m)\mid M_{z^{\prime}}=m,X=x\}\textup{pr}(M_{z^{\prime}}=m\mid X=x)
\displaystyle= \displaystyle\sum_{m}\underbrace{E\{Y(z,m)\mid X=x\}}_{\text{Assumption }\ref{assume::mediation4}}\underbrace{\textup{pr}(M=m\mid Z=z^{\prime},X=x)}_{\text{Assumption }\ref{assume::mediation3}}
\displaystyle= \displaystyle\sum_{m}\underbrace{E(Y\mid Z=z,M=m,X=x)}_{\text{Assumptions }\ref{assume::mediation1}\text{ and }\ref{assume::mediation2}}\textup{pr}(M=m\mid Z=z^{\prime},X=x).

\square

The above proof is trivial from a mathematical perspective. It illustrates the necessity of Assumptions 27.2–27.5.

Conditional on X=x, the mediation formulas for Y(1,M_{1}) and Y(0,M_{0}) simplify to

\displaystyle E\{Y(1,M_{1})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}E(Y\mid Z=1,M=m,X=x)\textup{pr}(M=m\mid Z=1,X=x)
\displaystyle= \displaystyle E(Y\mid Z=1,X=x)

and

\displaystyle E\{Y(0,M_{0})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}E(Y\mid Z=0,M=m,X=x)\textup{pr}(M=m\mid Z=0,X=x)
\displaystyle= \displaystyle E(Y\mid Z=0,X=x)

based on the law of total probability; the mediation formula for Y(1,M_{0}) simplifies to

\displaystyle E\{Y(1,M_{0})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}E(Y\mid Z=1,M=m,X=x)\textup{pr}(M=m\mid Z=0,X=x),

where the conditional expectation of the outcome is given Z=1 but the conditional distribution of the mediator is given Z=0. This leads to the identification formulas of the natural direct and indirect effects.

Corollary 27.1

Under Assumptions 27.2–27.5, the conditional natural direct and indirect effects are identified by

\displaystyle\textsc{nde}(x) \displaystyle= \displaystyle E\{Y(1,M_{0})-Y(0,M_{0})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}\{E(Y\mid Z=1,M=m,X=x)-E(Y\mid Z=0,M=m,X=x)\}
\displaystyle\qquad\times\textup{pr}(M=m\mid Z=0,X=x)

and

\displaystyle\textsc{nie}(x) \displaystyle= \displaystyle E\{Y(1,M_{1})-Y(1,M_{0})\mid X=x\}
\displaystyle= \displaystyle\sum_{m}E(Y\mid Z=1,M=m,X=x)
\displaystyle\qquad\times\{\textup{pr}(M=m\mid Z=1,X=x)-\textup{pr}(M=m\mid Z=0,X=x)\};

the unconditional ones can be identified by \textsc{nde}=\sum_{x}\textsc{nde}(x)\textup{pr}(X=x) and \textsc{nie}=\sum_{x}\textsc{nie}(x)\textup{pr}(X=x).

As a special case, with a binary M, the formula of the nie reduces to a product form below.

Corollary 27.2

Under Assumptions 27.2–27.5, for a binary mediator M, we have

\textsc{nie}(x)=\tau_{Z\rightarrow M}(x)\tau_{M\rightarrow Y}(1,x)

and \textsc{nie}=E\{\textsc{nie}(X)\}, where

\tau_{Z\rightarrow M}(x)=\textup{pr}(M=1\mid Z=1,X=x)-\textup{pr}(M=1\mid Z=0,X=x).

and

\tau_{M\rightarrow Y}(z,x)=E(Y\mid Z=z,M=1,X=x)-E(Y\mid Z=z,M=0,X=x)

I leave the proof of Corollary 27.2 as Problem 27.6. Corollary 27.2 gives a simple formula in the case of a binary M. With randomized Z conditional on X, we can view \tau_{Z\rightarrow M}(x) as the conditional average causal effect of Z on M. With randomized M conditional on (X,Z), we can view \tau_{M\rightarrow Y}(z,x) as the conditional average causal effect of M on Y. The conditional natural indirect effect equals their product. This is coherent with our intuition that the indirect effect acts from Z to M and then from M to Y.

142 The Mediation Formula Under Linear Models

Theorem 27.1 gives the nonparametric identification formula for mediation analysis. It allows us to derive various formulas for mediation analysis under different models. I will introduce the famous Baron–Kenny method under linear models below. VanderWeele, (2015) gives explicit formulas for the natural direct and indirect effects for many commonly used models. I relegate the details of other models to Section 144.

142.1 The Baron–Kenny Method
\textstyle{X\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\scriptstyle{\beta_{2}}\scriptstyle{\theta_{4}}\textstyle{Z\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\scriptstyle{\beta_{1}}\scriptstyle{\theta_{1}}\textstyle{M\ignorespaces\ignorespaces\ignorespaces\ignorespaces}\scriptstyle{\theta_{2}}\textstyle{Y}\textstyle{\text{indirect effect: }\beta_{1}\theta_{2}}\textstyle{\text{ direct effect: }\theta_{1}}
Figure 45: The Baron–Kenny method for mediation under linear models

The Baron–Kenny method assumes the following linear models for the mediator and outcome given the treatment and covariates.

Assumption 27.6 (linear models for the Baron–Kenny method)

Both the mediator and outcome follow linear models:

\left\{\begin{array}[]{rcl}E(M\mid Z,X)&=&\beta_{0}+\beta_{1}Z+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X,\\
E(Y\mid Z,M,X)&=&\theta_{0}+\theta_{1}Z+\theta_{2}M+\theta_{4}^{\mkern-1.5mu\mathsf{T}}X.\end{array}\right.

Under these linear models, the formulas for the natural direct and indirect effects simplify to functions of the coefficients.

Corollary 27.3 (Baron–Kenny formulas for mediation)

Under Assumptions 27.2–27.5 and 27.6, we have

\textsc{nde}=\theta_{1},\quad\textsc{nie}=\theta_{2}\beta_{1}.

The formulas in Corollary 27.3 are intuitive based on Figure 45. The direct effect equals the coefficient on the path Z\rightarrow Y, and the indirect effect equals the product of the coefficients on the path Z\rightarrow M\rightarrow Y. I give the proof below based on Theorem 27.1.

Proof of Corollary 27.3: The conditional NDE equals

\textsc{nde}(x)=\sum_{m}\theta_{1}\textup{pr}(M=m\mid Z=0,X=x)=\theta_{1}

and the conditional NIE equals

\displaystyle\textsc{nie}(x) \displaystyle= \displaystyle\sum_{m}(\theta_{0}+\theta_{1}+\theta_{2}m+\theta_{4}^{\mkern-1.5mu\mathsf{T}}x)
\displaystyle\qquad\times\{\textup{pr}(M=m\mid Z=1,X=x)-\textup{pr}(M=m\mid Z=0,X=x)\}
\displaystyle= \displaystyle\theta_{2}\{E(M=m\mid Z=1,X=x)-E(M=m\mid Z=0,X=x)\}
\displaystyle= \displaystyle\theta_{2}\beta_{1},

which do not depend on x. Therefore, they are also the formulas for the unconditional natural direct and indirect effects. \square

If we obtain OLS estimators of these coefficients, we can estimate the direct and indirect effects by

\hat{\textsc{nde}}=\hat{\theta}_{1},\qquad\hat{\textsc{nie}}=\hat{\theta}_{2}\hat{\beta}_{1},

which is called the Baron–Kenny method (Judd and Kenny,, 1981; Baron and Kenny,, 1986) although it had several antecedents (Hyman,, 1955; Alwin and Hauser,, 1975; Judd and Kenny,, 1981; Sobel,, 1982, e.g.,).

Standard software packages report the standard error of \hat{\textsc{nde}} from OLS. Sobel, (1982); Sobel, (1986) used the delta method to obtain the standard error of \hat{\textsc{nie}}. Based on the formula in Example 30.2, the asymptotic variance of \hat{\theta}_{2}\hat{\beta}_{1} equals \textup{var}(\hat{\theta}_{2})\beta_{1}^{2}+\theta_{2}^{2}\textup{var}(\hat{\beta}_{1}). So the estimated variance is

\hat{\textup{var}}(\hat{\theta}_{2})\hat{\beta}_{1}^{2}+\hat{\theta}_{2}^{2}\hat{\textup{var}}(\hat{\beta}_{1}).

Testing the null hypothesis of nie based on \hat{\theta}_{2}\hat{\beta}_{1} and the estimated variance above is called Sobel’s test in the literature of mediation analysis.

142.2 An Example

We can easily implement the Baron–Kenny method via the following code.

library("car")
BKmediation = function(Z, M, Y, X)
{
## two regressions and coefficients
mediator.reg = lm(M ~ Z + X)
mediator.Zcoef = mediator.reg$coef[2]
mediator.Zse = sqrt(hccm(mediator.reg)[2, 2])
outcome.reg = lm(Y ~ Z + M + X)
outcome.Zcoef = outcome.reg$coef[2]
outcome.Zse = sqrt(hccm(outcome.reg)[2, 2])
outcome.Mcoef = outcome.reg$coef[3]
outcome.Mse = sqrt(hccm(outcome.reg)[3, 3])
## Baron-Kenny point estimates
NDE = outcome.Zcoef
NIE = outcome.Mcoef*mediator.Zcoef
## Sobel’s variance estimate based the delta method
NDE.se = outcome.Zse
NIE.se = sqrt(outcome.Mse^2*mediator.Zcoef^2 +
outcome.Mcoef^2*mediator.Zse^2)
res = matrix(c(NDE, NIE,
NDE.se, NIE.se,
NDE/NDE.se, NIE/NIE.se),
2, 3)
rownames(res) = c("NDE", "NIE")
colnames(res) = c("est", "se", "t")
res
}

Revisiting Example 27.3, we obtain the following estimates for the direct and indirect effects:

> jobsdata = read.csv("jobsdata.csv")
> Z = jobsdata$treat
> M = jobsdata$job_seek
> Y = jobsdata$depress2
> getX = lm(treat ~ econ_hard + depress1 +
+ sex + age + occp + marital +
+ nonwhite + educ + income,
+ data = jobsdata)
> X = model.matrix(getX)[, -1]
> res = BKmediation(Z, M, Y, X)
> round(res, 3)
est se t
NDE -0.037 0.042 -0.885
NIE -0.014 0.009 -1.528

Both the estimates for the direct and indirect effects are negative although they are insignificant.

143 Sensitivity analysis

Mediation analysis relies on strong and untestable assumptions. One crucial assumption is that there is no unmeasured confounding among the treatment, mediator, and outcome. Various sensitivity analysis methods appeared in the literature. In particular, Ding and Vanderweele, (2016) proposed Cornfield-type sensitivity bounds, and Zhang and Ding, (2022) proposed a sensitivity analysis method tailored to the Baron–Kenny method based on linear structural equation models. These are beyond the scope of this book.

144 Homework problems

27.1 Robins and Greenland, (1992)’s clarification of the units based on nested potential outcomes

Assume (Z,M,Y) are all binary. Based on the joint value of

M(1),M(0),Y(1,M_{1}),Y(1,M_{0}),Y(0,M_{1}),Y(0,M_{0}),

how many types of units do we have?

If we assume monotonicity of Z on M, that is,

M(1)\geq M(0),

then how many types of units do we have?

If we further assume monotonicity of Z and M on Y, that is,

Y(1,m)\geq Y(0,m),\quad Y(z,1)\geq Y(z,0)

for all z and m, then how many types of units do we have?

27.2 Sequential randomization and joint randomization

Show (138) is equivalent to Assumptions 27.2 and 27.3.

27.3 Verifying the assumptions for mediation analysis

Show that Assumptions 27.2–27.5 hold under the data generating process in Example 27.4. Also show that if we allow \varepsilon_{M} and \varepsilon_{Y} to be \varepsilon_{M}(z) and \varepsilon_{Y}(z,m), then Assumptions 27.2–27.5 can fail.

27.4 Another set of assumptions for the mediation formula

Imai et al., (2010) invoked the following set of assumptions to derive the mediation formula.

Assumption 27.7

We have

\{Y(z,m),M(z^{\prime})\}\ind Z\mid X

and

Y(z,m)\ind M(z^{\prime})\mid(Z=z^{\prime},X)

for all z,z^{\prime},m.

Theorem 27.2

Under Assumption 27.7, the mediation formula in Theorem 27.1 holds.

Prove Theorem 27.2.

27.5 Difference method and product method are identical

In the main text, we first obtain the OLS fits

\left\{\begin{array}[]{rcl}\hat{M}_{i}&=&\hat{\beta}_{0}+\hat{\beta}_{1}Z_{i}+\hat{\beta}_{2}^{\mkern-1.5mu\mathsf{T}}X_{i},\\
\hat{Y}_{i}&=&\hat{\theta}_{0}+\hat{\theta}_{1}Z_{i}+\hat{\theta}_{2}M_{i}+\hat{\theta}_{4}^{\mkern-1.5mu\mathsf{T}}X_{i}.\end{array}\right.

The estimate for the NIE is the product \hat{\theta}_{2}\hat{\beta}_{1}, which is called the product method.

Alternatively, we can first obtain OLS fits:

\left\{\begin{array}[]{rcl}\hat{Y}_{i}&=&\hat{\alpha}_{0}+\hat{\alpha}_{1}Z_{i}+\hat{\alpha}_{1}^{\mkern-1.5mu\mathsf{T}}X_{i},\\
\hat{Y}_{i}&=&\hat{\theta}_{0}+\hat{\theta}_{1}Z_{i}+\hat{\theta}_{2}M_{i}+\hat{\theta}_{4}^{\mkern-1.5mu\mathsf{T}}X_{i}.\end{array}\right.

Another estimate for the NIE is the difference \hat{\alpha}_{1}-\hat{\theta}_{1}, which is called the difference method.

Show that \hat{\alpha}_{1}-\hat{\theta}_{1}=\hat{\theta}_{2}\hat{\beta}_{1}.

Remark: Recall Cochran’s formula in Problem 16.2.

27.6 Natural indirect effect with a binary mediator

Prove Corollary 27.2.

27.7 With treatment-outcome interaction on the outcome

VanderWeele, (2015) suggested using the following linear models:

\left\{\begin{array}[]{rcl}E(M\mid Z,X)&=&\beta_{0}+\beta_{1}Z+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X,\\
E(Y\mid Z,M,X)&=&\theta_{0}+\theta_{1}Z+\theta_{2}M+\theta_{3}ZM+\theta_{4}^{\mkern-1.5mu\mathsf{T}}X,\end{array}\right.

where the outcome model has the interaction term between the treatment and the mediator.

Under the above linear models, show that

\textsc{nde}=\theta_{1}+\theta_{3}\{\beta_{0}+\beta_{2}^{\mkern-1.5mu\mathsf{T}}E(X)\},\qquad\textsc{nie}=(\theta_{2}+\theta_{3})\beta_{1}.

How do we estimate nde and nie with IID data?

Remark: Consider the simple case with a binary Z and binary M. Under the linear models, the average causal effect of Z of M equals \beta_{1}, and the average causal effect of M on Y equals \theta_{2}+\theta_{3}E(Z). Therefore, it is possible that both of these effects are positive, but the natural indirect effect is negative. For instance:

\beta_{1}=1,\quad\theta_{2}=1,\quad\theta_{3}=-1.5,\quad E(Z)=0.5.

This is somewhat paradoxical and can be called the mediator paradox. Chen et al., (2007) reported a related surrogate endpoint paradox or intermediate variable paradox.

27.8 Mediation analysis with continuous mediator and binary outcome

Consider the following Normal linear model for the mediator and logistic model for the binary outcome:

\left\{\begin{array}[]{rcl}M\mid Z,X&\sim&\textsc{N}(\beta_{0}+\beta_{1}Z+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X,\sigma_{M}^{2}),\\
\textup{logit}\{\textup{pr}(Y=1\mid Z,M,X)\}&=&\theta_{0}+\theta_{1}Z+\theta_{2}M+\theta_{4}^{\mkern-1.5mu\mathsf{T}}X,\end{array}\right.

where \textup{logit}(w)=\log\{w/(1-w)\} with inverse \textup{expit}(w)=(1+e^{-w})^{-1}. Express nde and nie in terms of the model parameters and the distribution of X. How do we estimate nde and nie with IID data?

27.9 Mediation analysis with binary mediator and continuous outcome

Consider the following logistic model for the binary mediator and linear model for the outcome:

\left\{\begin{array}[]{rcl}\textup{logit}\{\textup{pr}(M=1\mid Z,X)\}&=&\beta_{0}+\beta_{1}Z+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X,\\
E(Y\mid Z,M,X)&=&\theta_{0}+\theta_{1}Z+\theta_{2}M+\theta_{4}^{\mkern-1.5mu\mathsf{T}}X.\end{array}\right.

Under these models, show that

\textsc{nde}=\theta_{1},\qquad\textsc{nie}=\theta_{2}E\left\{\textup{expit}(\beta_{0}+\beta_{1}+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X)-\textup{expit}(\beta_{0}+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X)\right\}.

How do we estimate nde and nie with IID data?

27.10 Mediation analysis with binary mediator and outcome

Consider the following logistic models for the binary mediator and outcome:

\left\{\begin{array}[]{rcl}\textup{logit}\{\textup{pr}(M=1\mid Z,X)\}&=&\beta_{0}+\beta_{1}Z+\beta_{2}^{\mkern-1.5mu\mathsf{T}}X,\\
\textup{logit}\{\textup{pr}(Y=1\mid Z,M,X)\}&=&\theta_{0}+\theta_{1}Z+\theta_{2}M+\theta_{4}^{\mkern-1.5mu\mathsf{T}}X.\end{array}\right.

Express nde and nie in terms of the model parameters and the distribution of X. How do we estimate nde and nie with IID data?

27.11 Modify the definitions to drop the cross-world independence

Define

Y(z,F_{M_{z^{\prime}}\mid X})=\int Y(z,m)f(M_{z^{\prime}}=m\mid X)\textnormal{d}m

as the potential outcome under treatment z and a random draw from the distribution of M_{z^{\prime}}\mid X. With a discrete M, the definition simplifies to

Y(z,F_{M_{z^{\prime}}\mid X})=\sum_{m}Y(z,m)\textup{pr}(M_{z^{\prime}}=m\mid X).

The key difference between Y(z,M_{z^{\prime}}) and Y(z,F_{M_{z^{\prime}}\mid X}) is that M_{z^{\prime}} is the potential mediator for the same unit whereas F_{M_{z^{\prime}}\mid X} is a random draw from the conditional distribution of the potential mediator in the whole population. Define the natural direct and indirect effects as

\textsc{nde}=E\{Y(1,F_{M_{0}\mid X})-Y(0,F_{M_{0}\mid X})\},\quad\textsc{nie}=E\{Y(1,F_{M_{1}\mid X})-Y(1,F_{M_{0}\mid X})\}.

Show that under Assumptions 27.2–27.4, the identification formulas for nde and nie remain the same as in the main text.

Remark: Modifying the definitions of the nested potential outcomes allows us to relax the strong cross-world independence assumption but weakens the interpretation of the natural direct and indirect effects. See VanderWeele, (2015) for more discussion and VanderWeele and Tchetgen Tchetgen, (2017) for an application to a more complex setting with time-varying treatment and mediator.

27.12 Connections between principal stratification and mediation analysis

VanderWeele, (2008) and Forastiere et al., (2018) reviewed and compared principal stratification and mediation analysis.

脚注

53. Recall Chapter 17 for Fisher’s hypothesis of a common genetic factor that affects the smoking behavior and lung cancer simultaneously.

54. By the probability theory, given the marginal distributions of \textup{pr}(Y(1)\leq y_{1}) and \textup{pr}(Y(0)\leq y_{0}), we can bound the joint distribution of \textup{pr}(Y(1)\leq y_{1},Y(0)\leq y_{0}) by the Frechet–Hoeffding inequality: \displaystyle\max\{0,\textup{pr}(Y(1)\leq y_{1})+\textup{pr}(Y(0)\leq y_{0})-1\} \displaystyle\leq \displaystyle\textup{pr}(Y(1)\leq y_{1},Y(0)\leq y_{0}) \displaystyle\leq \displaystyle\min\{\textup{pr}(Y(1)\leq y_{1}),\textup{pr}(Y(0)\leq y_{0})\}. This is often a loose inequality. Unfortunately, we do not have any information beyond this inequality without imposing additional assumptions.

本书:A First Course in Causal Inference,作者 Peng Ding。原文:arXiv:2305.18793v2,按 CC BY 4.0 许可发布。本站(yuanens.com)把 arXiv 网页版改成分章的纯 HTML,把公式渲染成图片,方便在 Kindle 等电子书阅读器上看,内容没有改动。转换难免有错,以原文为准。本站与作者和出版社无关。