Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.mediations

Plotting Indirect, Direct, and Total Effects from Multiple Mediation Analyses


Description

Function to plot results from multiple causal mediation analyses conducted via the mediations funciton. Output is a series of plots generated via plot.mediate for each treatment/mediator/outcome combination specified in the input 'mediations' object.

Usage

## S3 method for class 'mediations'
plot(x, which = names(x), ask = prod(par("mfcol"))
  < length(which) && dev.interactive(), ...)

Arguments

x

output from the mediations function.

which

subset of names(x), indicating which model combinations to be plotted. Default is to plot all.

ask

logical. If 'TRUE', the user is asked for input before a new figure is plotted. Default is to ask only if the number of plots on current screen is fewer the number implied by 'which'.

...

arguments passed to the plot.mediate function for individual plots.

Value

mediations returns an object of class mediations. The function summary is used to obtain a table of the results. The plot function instead plots these quantities. All additional parameters desired for the plotting of an output from mediate can be passed through.

Author(s)

Dustin Tingley, Harvard University, dtingley@gov.harvard.edu; Teppei Yamamoto, Massachusetts Institute of Technology, teppei@mit.edu.

See Also


mediation

Causal Mediation Analysis

v4.5.0
GPL (>= 2)
Authors
Dustin Tingley <dtingley@gov.harvard.edu>, Teppei Yamamoto <teppei@mit.edu>, Kentaro Hirose <hirose@princeton.edu>, Luke Keele <ljk20@psu.edu>, Kosuke Imai <kimai@princeton.edu>, Minh Trinh <mdtrinh@mit.edu>, Weihuang Wong <wwong@mit.edu>
Initial release
2019-9-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.