Description Usage Arguments Details Value Author(s) References See Also Examples
'multimed' is used for causal mediation analysis when post-treatment mediator-outcome confounders, or alternative mediators causally preceding the mediator of interest, exist in the hypothesized causal mechanisms. It estimates the average causal mediation effects (indirect effects) and the average direct effects under the homogeneous interaction assumption based on a varying-coefficient linear structural equation model. The function also performs sensitivity analysis with respect to the violation of the homogenous interaction assumption. The function can be used for both the single experiment design and the parallel design.
1 2 3 |
outcome |
name of the outcome variable in 'data'. |
med.main |
name of the mediator of interest. Under the parallel design this is the only mediator variable used in the estimation. |
med.alt |
vector of character strings indicating the names of the post-treatment confounders, i.e., the alternative mediators affecting both the main mediator and outcome. Not needed for the parallel design. |
treat |
name of the treatment variable in 'data'. |
covariates |
vector of character strings representing the names of the pre-treatment covariates. Cannot be used for the parallel design. |
experiment |
name of the binary indicator whether 'med.main' is randomly manipulated or not. Only used under the parallel design. |
data |
a data frame containing all the above variables. |
design |
experimental design used. Defaults to 'single'. |
sims |
number of bootstrap samples used for the calculation of confidence intervals. |
R2.by |
increment for the "R square tilde" parameter, i.e. the sensitivity parameter representing the proportion of residual outcome variance explained by heterogeneity in treatment-mediator interactions. Must be a numeric value between 0 and 1. |
conf.level |
level to be used for confidence intervals. |
weight |
name of the weights in 'data'. |
This function implements the framework proposed by Imai and Yamamoto
(2012) for the estimation and sensitivity analysis for multiple causal
mechanisms. It estimates the average causal mediation effects (indirect
effects) with respect to the mediator of interest ('med.main'), i.e., the
portion of the treatment effect on the outcome that is transmitted through
that mediator, as well as the average direct effects, i.e., the portion of
the treatment effect on the outcome that is not transmitted through the
main mediator. Unlike the "standard" causal mediation analysis implemented
by mediate
and medsens
, this framework allows
the existence of post-treatment covariates that confound the relationship
between the main mediator and the outcome, or equivalently, alternative
mediators ('med.alt') that causally precede the main mediator.
When the parallel design was used for the experiment (i.e. when the experiment contained an additional randomly assigned group for which both the treatment and the mediator were randomized), there is no need to specify a particular post-treatment confounder, for any such confounder (observed or unobserved) is allowed to exist by virtue of the design. Similarly, no observed covariates need to be included. The function instead requires an additional variable ('experiment') indicating whether the mediator was randomly manipulated for the unit.
The estimation and sensitivity analysis are both based on a varying-coefficient linear structural equations model, which assumes additivity but allows for an arbitrary degree of heterogeneity in model coefficients across units and thus is substantially more flexible than a traditional SEM framework. For details see Imai and Yamamoto (2012).
The function produces two sets of results. First, point estimates of the average causal mediation effects and the average direct effects are calculated, along with their (percentile) bootstrap confidence intervals. These estimates are based on the "homogeneous interaction" assumption, or the assumption that the degree of treatment-mediator interaction is constant across all units. The estimated total treatment effect is also reported.
Second, the bounds on the average causal mediation effects and the average direct effects are also estimated and computed for various degrees of interaction heterogeneity (i.e., violation of the identification assumption), which are represented by the values of three alternative sensitivity parameters. These parameters are: (1) sigma, the standard deviation of the (varying) regression coefficient on the interaction term, (2) R square star, the proportion of the residual variance that would be explained by an additional term for interaction heterogeneity, and (3) R square tilde, the proportion of the total variance explained by such a term. The confidence region is also calculated, using the Imbens and Manski (2004) formula with bootstrap standard errors. Further details are given in the above reference.
Note that rows with missing values will be omitted from the calculation of
the results. Also note that the treatment variable must be a numeric vector
of 1 and 0 and that both mediators and outcome variable must be numeric.
The pre-treatment covariates can be of any type that lm
can
handle as predictors.
multimed
returns an object of class "multimed
", a list
contains the following components. The object can be passed to the
summary
and plot
method functions for a summary table and a
graphical summary.
sigma |
values of the sigma sensitivity parameter at which the bounds and confidence intervals are evaluated. |
R2tilde |
values of the R square tilde parameter. |
R2star |
values of the R square star parameter. |
d1.lb, d0.lb, d.ave.lb |
lower bounds on the average causal mediation effects under treatment, control, and the simple average of the two, respectively, corresponding to the values of the sensitivity parameters listed above. Note that the first elements of these vectors equal the point estimates under the homogeneous interaction assumption. |
d1.ub, d0.ub, d.ave.ub |
upper bounds on the average causal mediation effects. |
d1.ci, d0.ci, d.ave.ci |
confidence intervals for the average causal mediation effects at different values of the sensitivity parameters. |
z1.lb, z0.lb, z.ave.lb |
lower bounds on the average direct effects under treatment, control, and the simple average of the two, respectively, corresponding to the values of the sensitivity parameters listed above. Note that the first elements of these vectors equal the point estimates under the homogeneous interaction assumption. |
z1.ub, z0.ub, z.ave.ub |
upper bounds on the average direct effects. |
z1.ci, z0.ci, z.ave.ci |
confidence intervals for the average direct effects at different values of the sensitivity parameters. |
tau |
point estimate of the total treatment effect. |
tau.ci |
confidence interval for the total treatment effect. |
conf.level |
confidence level used for the calculation of the confidence intervals. |
Teppei Yamamoto, Massachusetts Institute of Technology, teppei@mit.edu
Tingley, D., Yamamoto, T., Hirose, K., Imai, K. and Keele, L. (2014). "mediation: R package for Causal Mediation Analysis", Journal of Statistical Software, Vol. 59, No. 5, pp. 1-38.
Imai, K. and Yamamoto, T. (2012) Identification and Sensitivity Analysis for Multiple Causal Mechanisms: Revisiting Evidence from Framing Experiments, Unpublished manuscript.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Replicates Figure 3 (right column) of Imai and Yamamoto (2012)
# Note: # of bootstrap samples set low for quick illustration
data(framing)
Xnames <- c("age", "educ", "gender", "income")
res <- multimed("immigr", "emo", "p_harm", "treat", Xnames,
data = framing, design = "single", sims = 10)
summary(res)
plot(res, type = "point")
plot(res, type = c("sigma", "R2-total"), tgroup = "average")
# Parallel design example using the simulated data of Imai, Tingley and Yamamoto (2012)
data(boundsdata)
res.para <- multimed(outcome = "out", med.main = "med", treat = "ttt", experiment = "manip",
data = boundsdata, design = "parallel", sims = 10)
summary(res.para)
plot(res.para, tg = "av")
## End(Not run)
|
Loading required package: MASS
Loading required package: Matrix
Loading required package: mvtnorm
Loading required package: sandwich
mediation: Causal Mediation Analysis
Version: 4.4.7
Causal Mediation Analysis with Confounding by an Alternative Mechanism
Estimates under the Homogeneous Interaction Assumption:
Estimate 95% CI Lower 95% CI Upper
ACME (treated) 0.0645 -0.0403 0.17
ACME (control) 0.1240 0.0486 0.20
ACME (average) 0.1087 0.0486 0.17
ADE (treated) 0.2935 0.0817 0.51
ADE (control) 0.3531 0.1663 0.54
ADE (average) 0.3378 0.1538 0.52
Total Effect 0.4175 0.3009 0.55
Sensitivity Analysis:
Values of the sensitivity parameters at which ACME first crosses zero:
sigma(bounds) sigma(CI) R2s(bounds) R2s(CI) R2t(bounds) R2t(CI)
ACME (treated) 0.0299 0.0000 0.0300 0.0000 0.0178 0.00
ACME (control) 0.0489 0.0244 0.0800 0.0200 0.0474 0.01
ACME (average) 0.0423 0.0244 0.0600 0.0200 0.0356 0.01
Values of the sensitivity parameters at which ADE first crosses zero:
sigma(bounds) sigma(CI) R2s(bounds) R2s(CI) R2t(bounds) R2t(CI)
ADE (treated) 0.1106 0.0457 0.4100 0.0700 0.2430 0.04
ADE (control) 0.1393 0.0792 0.6500 0.2100 0.3853 0.12
ADE (average) 0.1316 0.0733 0.5800 0.1800 0.3438 0.11
Causal Mediation Analysis with Confounding by an Alternative Mechanism
Estimates under the Homogeneous Interaction Assumption:
Estimate 95% CI Lower 95% CI Upper
ACME (treated) 0.362 0.292 0.43
ACME (control) 0.307 0.251 0.36
ACME (average) 0.322 0.265 0.38
ADE (treated) -0.101 -0.186 -0.02
ADE (control) -0.156 -0.236 -0.08
ADE (average) -0.140 -0.218 -0.06
Total Effect 0.206 0.168 0.27
Sensitivity Analysis:
Values of the sensitivity parameters at which ACME first crosses zero:
sigma(bounds) sigma(CI) R2s(bounds) R2s(CI) R2t(bounds) R2t(CI)
ACME (treated) 0.779 0.653 0.370 0.260 0.344 0.24
ACME (control) 0.627 0.528 0.240 0.170 0.223 0.16
ACME (average) 0.665 0.573 0.270 0.200 0.251 0.19
Values of the sensitivity parameters at which ADE first crosses zero:
sigma(bounds) sigma(CI) R2s(bounds) R2s(CI) R2t(bounds) R2t(CI)
ADE (treated) 0.2218 0.1281 0.0300 0.0100 0.0279 0.01
ADE (control) 0.3388 0.2218 0.0700 0.0300 0.0651 0.03
ADE (average) 0.3137 0.1811 0.0600 0.0200 0.0558 0.02
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.