summary.test_mediation | R Documentation |
Summarize results from (robust) mediation analysis for proper interpretation.
## S3 method for class 'boot_test_mediation'
summary(object, type = c("boot", "data"), plot = TRUE, ...)
## S3 method for class 'sobel_test_mediation'
summary(object, ...)
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. |
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
|
Andreas Alfons
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.
test_mediation()
, weight_plot()
data("BSG2014")
## seed to be used for the random number generator
seed <- 20150601
## simple mediation
set.seed(seed)
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
# depending on the seed of the random number generator, one
# may get a p value slightly below or above the arbitrary
# 5% threshold
p_value(boot_simple, parm = "indirect")
# The results in Alfons et al. (2022a) were obtained with an
# older version of the random number generator and with BCa
# bootstrap intervals (which are no longer recommended).
# To reproduce those results, uncomment the lines below.
# RNGversion("3.5.3")
# set.seed(seed)
# boot_simple <- test_mediation(TeamCommitment ~
# m(TaskConflict) +
# ValueDiversity,
# data = BSG2014,
# type = "bca")
# summary(boot_simple)
## serial multiple mediators
set.seed(seed)
boot_serial <- test_mediation(TeamScore ~
serial_m(TaskConflict,
TeamCommitment) +
ValueDiversity,
data = BSG2014,
level = 0.9)
summary(boot_serial)
## parallel multiple mediators and control variables
set.seed(seed)
boot_parallel <- test_mediation(TeamPerformance ~
parallel_m(ProceduralJustice,
InteractionalJustice) +
SharedLeadership +
covariates(AgeDiversity,
GenderDiversity),
data = BSG2014)
summary(boot_parallel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.