Plot the overall mediation effect or decomposed indirect effect from the selected mediator.
Usage
## S3 method for class 'mlma'
plot(x, ..., var = NULL, cate = FALSE, w2 = rep(1, length(object$de2)))
Arguments
x
an "mlma" object.
...
arguments to be passed to methods.
var
the name of the mediator that is to be plotted. If var is NULL, plot the relative mediation effects of all mediators.
cate
TRUE when the mediator is a categorical variable. By default is FALSE.
w2
the weight for observations at level 2, which should be the same order as unique(level[!is.na(level)]). The default is rep(1,length(object$de2)).
Details
Plot the relative effects of direct effects and indirect effects of mediators at level 1 (if levelx=1) and level 2 respectively if var=NULL. Otherwise, plot the indirect effect of var, the estimated differential effect of the predictor on var, and the predicted relationship between y and var at individual level and/or (aggregated) group level.
Author(s)
Qingzhao Yu (qyu@lsuhsc.edu), Bin Li (bli@lsu.edu).