Function to plot results from mediate
. The vertical axis lists
indirect, direct, and total effects and the horizontal axis indicates the
respective magnitudes. Most standard options for plot function available.
# S3 method for mediate
plot(x, treatment = NULL, labels = NULL,
effect.type = c("indirect", "direct", "total"), xlim = NULL,
ylim = NULL, xlab = "", ylab = "", main = NULL, lwd = 1.5,
cex = 0.85, col = "black", ...)
object of class mediate
or mediate.order
as produced
by mediate
.
a character string indicating the baseline treatment value of the estimated causal mediation effect and direct effect to plot. Can be either "control", "treated" or "both". If 'NULL' (default), both sets of estimates are plotted if and only if they differ.
a vector of character strings indicating the labels for the estimated effects. The default labels will be used if NULL.
a vector indicating which quantities of interest to plot. Default is to plot all three quantities (indirect, direct and total effects).
range of the horizontal axis.
range of the vertical axis.
label of the horizontal axis.
label of the vertical axis.
main title.
width of the horizontal bars for confidence intervals.
size of the dots for point estimates.
color of the dots and horizontal bars for the estimates.
additional parameters passed to 'plot'.
mediate
returns an object of class "mediate
". The
function summary
is used to obtain a table of the results. The
plot
function plots these quantities.
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., Keele, L. and Tingley, D. (2010) A General Approach to Causal Mediation Analysis, Psychological Methods, Vol. 15, No. 4 (December), pp. 309-334.
Imai, K., Keele, L. and Yamamoto, T. (2010) Identification, Inference, and Sensitivity Analysis for Causal Mediation Effects, Statistical Science, Vol. 25, No. 1 (February), pp. 51-71.
Imai, K., Keele, L., Tingley, D. and Yamamoto, T. (2009) "Causal Mediation Analysis Using R" in Advances in Social Science Research Using R, ed. H. D. Vinod New York: Springer.