retest | R Documentation |
Re-perform a test for the indirect effect(s) based on results from (robust)
mediation analysis. This function is purely available for computational
convenience if the analysis was accidentally run with the wrong parameter
settings, as it avoids having to re-run the bootstrap procedure. It must
not be abused for p
-hacking.
retest(object, ...)
## S3 method for class 'boot_test_mediation'
retest(object, alternative, level, type, contrast, ...)
## S3 method for class 'sobel_test_mediation'
retest(object, alternative, order, ...)
object |
an object inheriting from class
|
... |
additional arguments to be passed down to methods. |
alternative |
a character string specifying the alternative hypothesis
in the test for the indirect effect. Possible values are |
level |
numeric; the confidence level of the confidence interval in the bootstrap test. |
type |
a character string specifying the type of confidence interval
to be computed in the bootstrap test. Possible values are |
contrast |
a logical indicating whether to compute pairwise contrasts
of the indirect effects. This can also be a character string, with
|
order |
a character string specifying the order of approximation of
the standard error in Sobel's test. Possible values are |
An object of the same class as object
with updated test
results (see test_mediation()
).
From version 0.9.0 onwards, the behavior of this function changed. For
arguments that are not supplied, the corresponding values of object
are now used as defaults.
Since version 1.1.0, bias-corrected and accelerated (BCa) bootstrap
confidence intervals are no longer recommended, and the option
type = "bca"
may disappear in the future.
Andreas Alfons
test_mediation()
data("BSG2014")
# run fast-and-robust bootstrap test
boot <- test_mediation(BSG2014,
x = "SharedLeadership",
y = "TeamPerformance",
m = c("ProceduralJustice",
"InteractionalJustice"),
covariates = c("AgeDiversity",
"GenderDiversity"))
summary(boot)
# now include comparison of indirect effects
retest(boot, contrast = "estimates")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.