retest: Retest for mediation

Description Usage Arguments Value Author(s) See Also Examples

View source: R/retest.R

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

1
2
3
4
5
6
7
8
9
retest(object, ...)

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

## S3 method for class '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).

Author(s)

Andreas Alfons

See Also

test_mediation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

robmed documentation built on Nov. 5, 2018, 5:06 p.m.