summary.test_mediation {robmed} | R Documentation |
Summary of results from (robust) mediation analysis
Description
Summarize results from (robust) mediation analysis for proper interpretation.
Usage
## S3 method for class 'boot_test_mediation'
summary(object, type = c("boot", "data"), plot = TRUE, ...)
## S3 method for class 'sobel_test_mediation'
summary(object, ...)
Arguments
object |
an object inheriting from class
|
type |
a character string specifying how to summarize the effects
other than the indirect effect(s). Possible values are |
plot |
a logical indicating whether to include a diagnostic plot of
robust regression weights (see |
... |
additional arguments are currently ignored. |
Value
An object of class "summary_test_mediation"
with the
following components:
object |
the |
summary |
an object containing all necessary information to summarize the effects other than the indirect effect(s). |
plot |
if applicable, an object inheriting from class
|
Author(s)
Andreas Alfons
References
Alfons, A., Ates, N.Y. and Groenen, P.J.F. (2022a) A Robust Bootstrap Test for Mediation Analysis. Organizational Research Methods, 25(3), 591–617. doi:10.1177/1094428121999096.
Alfons, A., Ates, N.Y. and Groenen, P.J.F. (2022b) Robust Mediation Analysis: The R Package robmed. Journal of Statistical Software, 103(13), 1–45. doi:10.18637/jss.v103.i13.
See Also
test_mediation()
, weight_plot()
Examples
data("BSG2014")
## seed to be used for the random number generator
seed <- 20211117
## simple mediation
# set seed of the random number generator
set.seed(seed)
# The results in Alfons et al. (2022a) were obtained with an
# older version of the random number generator. To reproduce
# those results, uncomment the two lines below.
# RNGversion("3.5.3")
# set.seed(20150601)
# perform mediation analysis
boot_simple <- test_mediation(TeamCommitment ~
m(TaskConflict) +
ValueDiversity,
data = BSG2014)
summary(boot_simple)
# the diagnostic plot is not shown when the summary is
# computed, only when the resulting object is printed
summary_simple <- summary(boot_simple) # does not show plot
summary_simple # shows output and plot
## serial multiple mediators
# set seed of the random number generator
set.seed(seed)
# perform mediation analysis
boot_serial <- test_mediation(TeamScore ~
serial_m(TaskConflict,
TeamCommitment) +
ValueDiversity,
data = BSG2014)
summary(boot_serial)
## parallel multiple mediators and control variables
# set seed of the random number generator
set.seed(seed)
# perform mediation analysis
boot_parallel <- test_mediation(TeamPerformance ~
parallel_m(ProceduralJustice,
InteractionalJustice) +
SharedLeadership +
covariates(AgeDiversity,
GenderDiversity),
data = BSG2014)
summary(boot_parallel)