Learn R Programming

robmed (version 0.6.0)

confint.test_mediation: Confidence intervals for (robust) mediation analysis

Description

Extract or compute confidence intervals for coefficients from (robust) mediation analysis.

Usage

# S3 method for boot_test_mediation
confint(object, parm = NULL,
  level = NULL, type = c("boot", "data"), ...)

# S3 method for sobel_test_mediation confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

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

parm

an integer, character or logical vector specifying the coefficients for which to extract or compute confidence intervals, or NULL to extract or compute confidence intervals for all coefficients.

level

for the "boot_test_mediation" method, this is ignored and the confidence level of the bootstrap confidence interval for the indirect effect is used. For the other methods, the confidence level of the confidence intervals to be computed. The default is to compute 95% confidence intervals.

type

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

additional arguments are currently ignored.

Value

A numeric matrix containing the requested confidence intervals.

See Also

test_mediation(), coef()

Examples

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

# run fast and robust bootstrap test
robust_boot <- test_mediation(BSG2014,
                              x = "ValueDiversity",
                              y = "TeamCommitment",
                              m = "TaskConflict",
                              robust = TRUE)
confint(robust_boot, type = "boot")

# run standard bootstrap test
standard_boot <- test_mediation(BSG2014,
                                x = "ValueDiversity",
                                y = "TeamCommitment",
                                m = "TaskConflict",
                                robust = FALSE)
confint(standard_boot, type = "data")

# }

Run the code above in your browser using DataLab