summary.test_mediation: Summary of results from (robust) mediation analysis

summary.test_mediationR 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 "test_mediation" containing results from (robust) mediation analysis.

type

a character string specifying how to summarize the effects other than the indirect effect(s). Possible values are "boot" (the default) to compute significance tests using the normal approximation of the bootstrap distribution (i.e., to assume a normal distribution of the corresponding effect with the standard deviation computed from the bootstrap replicates), or "data" to compute significance tests via statistical theory based on the original data (e.g., t-tests if the coefficients are estimated via regression). Note that this is only relevant for mediation analysis via a bootstrap test, where significance of the indirect effect is always assessed via a percentile-based confidence interval due to the asymmetry of its distribution.

plot

a logical indicating whether to include a diagnostic plot of robust regression weights (see weight_plot()). This is only used for mediation analysis objects fitted with the robust MM-estimator (see test_mediation()). Note that the diagnostic plot is only shown when the returned object is printed in order to maintain a clear separation between computing results and printing/plotting them.

...

additional arguments are currently ignored.

Value

An object of class "summary_test_mediation" with the following components:

object

the object passed to the summary method, which contains the results from testing the indirect effect(s).

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 "ggplot" containing the diagnostic plot.

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)



robmed documentation built on July 9, 2023, 6:29 p.m.