View source: R/plot.mediation.R
plot.mediation | R Documentation |
mediation
object.Plot the mediation
object.
## S3 method for class 'mediation' plot(x, subset = NULL, color = TRUE, ...)
x |
weighted_mediation object |
subset |
Used to restrict which of the |
color |
If |
... |
Additional arguments. |
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. .
wgtmed
for function input
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.