plot.mediation {twangMediation} | R Documentation |
Plot the mediation
object.
Description
Plot the mediation
object.
Usage
## S3 method for class 'mediation'
plot(x, subset = NULL, color = TRUE, ...)
Arguments
x |
weighted_mediation object |
subset |
Used to restrict which of the |
color |
If |
... |
Additional arguments. |
Value
Distribution plots of NIE1 (distribution of mediator for treatment sample weighted to match distribution of mediator under control for the population) and NIE0 (distribution of mediator for control sample weighted to match distribution of mediator under treatment for the population) for each mediator. For continuous mediators, distributions are plotted with density curves and for categorical (factor) mediators, distributions are plotted with barplots. .
See Also
wgtmed
for function input
Examples
data("tMdat")
## tMdat is small simulated data set included in twangMediation for
## demonstrating the functions. See ?tMdat for details
fit.es.max <- wgtmed(M ~ w1 + w2 + w3,
data = tMdat,
a_treatment = "A",
y_outcome = "Y",
total_effect_wts = tMdat$te.wgt,
method = "ps",
ps_n.trees=1500,
ps_shrinkage=0.01,
ps_stop.method=c("es.max")
)
plot(fit.es.max)