Session 12
MATH 80667A: Experimental Design and Statistical Methods
HEC Montréal
Confounding Common cause Causal forks X ← Z → Y
Causation Mediation Causal chain X → Z → Y
Collision
Selection /
endogeneity
inverted fork X → Z ← Y
Define
Directed acyclic graph of the linear mediation model
Z are potential confounders. If we randomly allocate X (experiment), then all incoming arrows vanish and we have no confounder for X vs M or X vs Y.
The ADE measures the flow along X→Y, disabling the pathway X→M→Y by fixing the mediator value: it is ADE(x)=E[Yi(1,Mi(x))−Yi(0,Mi(x))}
This measures the expected change in response when the experimental factor changes from treatment to control, while the mediator is set to a fixed value Mi(x) uniformly over the population. Fixing the mediator may or not be feasible experimentally.
If there is no interaction between the treatment and the mediator, then ADE(0)=ADE(1).
Also called indirect effect, obtained for a fixed intervention due to changing the values of the mediator to those it would take under the treatment and control group, respectively Mi(1) and Mi(0).
ACME(x)=E[Yi{x,Mi(1)}−Yi{x,Mi(0)}]
If there is no interaction between the treatment and the mediator, then ACME(0)=ACME(1)
Total effect: overall impact of X (both through M and directly)
TE=E[Y∣do(X=1)]−E[Y∣do(X=0)]
X → M → Y
plus
X → Y
The total effect is the average change in response if we randomize treatment assignment and consider the difference treatment vs control.
The total effect measures the average overall impact of changes in outcome Y (both through M and directly) when experimentally manipulating X, TE=E[Yi{1,M(1)}]−E[Yi{0,M(0)}],
The values of the average causal mediation effect and the average direct effect are the same regardless of the treatment assignment x if there is no interaction.
Consider the following two linear regression models with a binary treatment X∈{0,1} and M binary or continuous:
Mβdmediator=cmβdintercept+αX+εmβerror termYβdresponse=cyβintercept+βXdirect effect+γM+εyβerror term
We assume that zero-mean error terms εm and εy are uncorrelated.
Plugging the first equation in the second, we get the marginal model for Y given treatment X E(Y∣X=x)=(cy+γcm)intercept+(β+αγ)total effect⋅x
In an experiment, we can obtain the total effect via the ANOVA model, with
Y=νaverage of control+τXtotal effect+εY′error termτ=E{Y∣do(X=1)}−E{Y∣do(X=0)}
In the linear mediation model of Baron and Kenny, the quantities of interest are
ACME(x)=E[Y{x,M(1)}−Y{x,M(0)}]=αγADE(x)=E[Y{1,M(x)}−Y{0,M(x)}]=βTE=E[Y{1,M(1)}−Y{0,M(0)}]=β+αγ
There are three main assumptions for this quantity to be a valid estimator of the causal mediation effect
Based on estimators of coefficients ˆα and ˆγ, construct a test statistic S=ˆαˆγ−0se(ˆαˆγ)
The coefficient and variance estimates can be extracted from the output of the regression model.
In large sample, S⋅∼Normal(0,1), but this approximation may be poor in small samples.
Without interaction/accounting for confounders, αγ=τ−β and with OLS we get exactly the same point estimates. The derivation of the variance is then relatively straightforward using the delta method.
Sobel's test is not the only test. Alternative statistics are discussed in
MacKinnon, D. P., Lockwood, C. M., Hoffman, J. M., West, S. G., & Sheets, V. (2002). A comparison of methods to test mediation and other intervening variable effects. Psychological Methods, 7(1), 83–104. https://doi.org/10.1037/1082-989X.7.1.83
An alternative to estimate p-value and the confidence interval is through the nonparametric bootstrap with the percentile method, popularized by Preacher and Hayes (2004)
Nonparametric bootstrap: repeat B times, say B=10 000
Percentile-based method: for a equitailed 1−α interval
Run the nonparametric bootstrap and obtain estimates ˆα(b) and ˆγ(b) from the bth bootstrap sample.
Compute the α/2 and 1−α/2 empirical quantiles of {ˆα(b)ˆγ(b)}Bb=1.
Compute the sample proportion of bootstrap statistics that are larger/smaller than zero.
p=2min{M/B,1−M/B}.
Note: many bootstraps! parametric, wild, sieve, block, etc. and many methods (basic, studentized, bias corrected and accelerated) for confidence intervals
Same assumptions as analysis of variance and linear models
Conclusions about mediation are valid only when causal assumptions hold.
Assuming that X is randomized, we need
The no-unmeasured confounders assumption should be challenged.
Check the robustness of the conclusions by considering potential correlation between errors, as E(ˆγ)=γ+Cor(εm,εy)√Va(εy)Va(εm)
medsens
function in the R package mediation
implements the diagnostic of Imai, Keele and Yamamoto (2010) for the linear mediation model.
Keenan Crane
Consider a more complex setting where the effect of the experimental factor X depends on the mediator, a case termed moderated mediator Judd and Kenny (1982).
In this case, the equation for the response variable becomes E(Y∣M=m,X=x,Z=z)=cY+βx+γm+κxm+zω
Upon substituting the equations for both inside the definition of average causal mediation effect, we find that the latter equals ACME(x)=(γ+κx){M(1)−M(0)}=α(γ+κx). and thus the value differs depending on experimental regime (treatment or control), due to the presence of the interaction.
Both the average direct and total effects now depend on the theoretical average values of the covariates Z added to the model to control for confounding.
Imai et al. (2010) suggest using simulation for general models that naturally account for nonlinear effects, different natures of the mediator (binary, categorical, etc.) and the response.
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
o | Tile View: Overview of Slides |
Esc | Back to slideshow |
Session 12
MATH 80667A: Experimental Design and Statistical Methods
HEC Montréal
Confounding Common cause Causal forks X ← Z → Y
Causation Mediation Causal chain X → Z → Y
Collision
Selection /
endogeneity
inverted fork X → Z ← Y
Define
Directed acyclic graph of the linear mediation model
Z are potential confounders. If we randomly allocate X (experiment), then all incoming arrows vanish and we have no confounder for X vs M or X vs Y.
The ADE measures the flow along X→Y, disabling the pathway X→M→Y by fixing the mediator value: it is ADE(x)=E[Yi(1,Mi(x))−Yi(0,Mi(x))}
This measures the expected change in response when the experimental factor changes from treatment to control, while the mediator is set to a fixed value Mi(x) uniformly over the population. Fixing the mediator may or not be feasible experimentally.
If there is no interaction between the treatment and the mediator, then ADE(0)=ADE(1).
Also called indirect effect, obtained for a fixed intervention due to changing the values of the mediator to those it would take under the treatment and control group, respectively Mi(1) and Mi(0).
ACME(x)=E[Yi{x,Mi(1)}−Yi{x,Mi(0)}]
If there is no interaction between the treatment and the mediator, then ACME(0)=ACME(1)
Total effect: overall impact of X (both through M and directly)
TE=E[Y∣do(X=1)]−E[Y∣do(X=0)]
X → M → Y
plus
X → Y
The total effect is the average change in response if we randomize treatment assignment and consider the difference treatment vs control.
The total effect measures the average overall impact of changes in outcome Y (both through M and directly) when experimentally manipulating X, TE=E[Yi{1,M(1)}]−E[Yi{0,M(0)}],
The values of the average causal mediation effect and the average direct effect are the same regardless of the treatment assignment x if there is no interaction.
Consider the following two linear regression models with a binary treatment X∈{0,1} and M binary or continuous:
Mβdmediator=cmβdintercept+αX+εmβerror termYβdresponse=cyβintercept+βXdirect effect+γM+εyβerror term
We assume that zero-mean error terms εm and εy are uncorrelated.
Plugging the first equation in the second, we get the marginal model for Y given treatment X E(Y∣X=x)=(cy+γcm)intercept+(β+αγ)total effect⋅x
In an experiment, we can obtain the total effect via the ANOVA model, with
Y=νaverage of control+τXtotal effect+εY′error termτ=E{Y∣do(X=1)}−E{Y∣do(X=0)}
In the linear mediation model of Baron and Kenny, the quantities of interest are
ACME(x)=E[Y{x,M(1)}−Y{x,M(0)}]=αγADE(x)=E[Y{1,M(x)}−Y{0,M(x)}]=βTE=E[Y{1,M(1)}−Y{0,M(0)}]=β+αγ
There are three main assumptions for this quantity to be a valid estimator of the causal mediation effect
Based on estimators of coefficients ˆα and ˆγ, construct a test statistic S=ˆαˆγ−0se(ˆαˆγ)
The coefficient and variance estimates can be extracted from the output of the regression model.
In large sample, S⋅∼Normal(0,1), but this approximation may be poor in small samples.
Without interaction/accounting for confounders, αγ=τ−β and with OLS we get exactly the same point estimates. The derivation of the variance is then relatively straightforward using the delta method.
Sobel's test is not the only test. Alternative statistics are discussed in
MacKinnon, D. P., Lockwood, C. M., Hoffman, J. M., West, S. G., & Sheets, V. (2002). A comparison of methods to test mediation and other intervening variable effects. Psychological Methods, 7(1), 83–104. https://doi.org/10.1037/1082-989X.7.1.83
An alternative to estimate p-value and the confidence interval is through the nonparametric bootstrap with the percentile method, popularized by Preacher and Hayes (2004)
Nonparametric bootstrap: repeat B times, say B=10 000
Percentile-based method: for a equitailed 1−α interval
Run the nonparametric bootstrap and obtain estimates ˆα(b) and ˆγ(b) from the bth bootstrap sample.
Compute the α/2 and 1−α/2 empirical quantiles of {ˆα(b)ˆγ(b)}Bb=1.
Compute the sample proportion of bootstrap statistics that are larger/smaller than zero.
p=2min{M/B,1−M/B}.
Note: many bootstraps! parametric, wild, sieve, block, etc. and many methods (basic, studentized, bias corrected and accelerated) for confidence intervals
Same assumptions as analysis of variance and linear models
Conclusions about mediation are valid only when causal assumptions hold.
Assuming that X is randomized, we need
The no-unmeasured confounders assumption should be challenged.
Check the robustness of the conclusions by considering potential correlation between errors, as E(ˆγ)=γ+Cor(εm,εy)√Va(εy)Va(εm)
medsens
function in the R package mediation
implements the diagnostic of Imai, Keele and Yamamoto (2010) for the linear mediation model.
Keenan Crane
Consider a more complex setting where the effect of the experimental factor X depends on the mediator, a case termed moderated mediator Judd and Kenny (1982).
In this case, the equation for the response variable becomes E(Y∣M=m,X=x,Z=z)=cY+βx+γm+κxm+zω
Upon substituting the equations for both inside the definition of average causal mediation effect, we find that the latter equals ACME(x)=(γ+κx){M(1)−M(0)}=α(γ+κx). and thus the value differs depending on experimental regime (treatment or control), due to the presence of the interaction.
Both the average direct and total effects now depend on the theoretical average values of the covariates Z added to the model to control for confounding.
Imai et al. (2010) suggest using simulation for general models that naturally account for nonlinear effects, different natures of the mediator (binary, categorical, etc.) and the response.