Learn R Programming

robmed (version 0.4.0)

retest: Retest for mediation

Description

Reperform a (fast and robust) bootstrap test or Sobel's test for the indirect effect(s) based on results from (robust) mediation analysis.

Usage

retest(object, ...)

# S3 method for boot_test_mediation retest(object, alternative = c("twosided", "less", "greater"), level = 0.95, type = c("bca", "perc"), ...)

# S3 method for sobel_test_mediation retest(object, alternative = c("twosided", "less", "greater"), ...)

Arguments

object

an object inheriting from class "test_mediation" containing results from (robust) mediation analysis.

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 "twosided" (the default), "less" or "greater".

level

numeric; the confidence level of the confidence interval in the bootstrap test. The default is to compute a 95% confidence interval.

type

a character string specifying the type of confidence interval to be computed in the bootstrap test. Possible values are "bca" (the default) for the bias-corrected and accelerated bootstrap, or "perc" for the percentile bootstrap.

Value

An object of the same class as object with updated test results (see test_mediation).

See Also

test_mediation

Examples

Run this code
# NOT RUN {
data("BSG2014")

# run fast and robust bootstrap test
test <- test_mediation(BSG2014,
                       x = "ValueDiversity",
                       y = "TeamCommitment",
                       m = "TaskConflict")
summary(test)

# now compute 97.5% confidence interval
retest(test, level = 0.975)

# }

Run the code above in your browser using DataLab