p_value {robmed} | R Documentation |
p-Values from (robust) mediation analysis
Description
Compute or extract the p-values for effects in (robust) mediation analysis.
Usage
p_value(object, ...)
## S3 method for class 'boot_test_mediation'
p_value(object, parm = NULL, type = c("boot", "data"), digits = 4L, ...)
## S3 method for class 'sobel_test_mediation'
p_value(object, parm = NULL, ...)
Arguments
object |
an object inheriting from class
|
... |
for the generic function, additional arguments to be passed down to methods. For the methods, additional arguments are currently ignored. |
parm |
an integer, character or logical vector specifying the paths
for which to extract or compute p-values, or |
type |
a character string specifying how to compute the p-values of
the effects other than the indirect effect(s). Possible values are
|
digits |
an integer determining how many digits to compute for the p-values of the indirect effects (see ‘Details’). The default is to compute 4 digits after the comma. |
Details
For bootstrap tests, the p-value of the indirect effect is computed as the
smallest significance level \alpha
for which the
(1 - \alpha) * 100\%
confidence interval obtained
from the bootstrapped distribution does not contain 0.
This is a simple implementation, where each digit after the comma is
determined via a grid search. Hence computation time can be long if
confidence intervals are computed via the bias-corrected and accelerated
method ("bca"
).
For Sobel tests, the p-value of the indirect effect is already stored in the
object returned by test_mediation()
and is simply extracted.
Value
A numeric vector containing the requested p-values.
Author(s)
Andreas Alfons
See Also
test_mediation()
, coef()
,
confint()
Examples
data("BSG2014")
# BCa intervals are recommended, but take a while to run
boot <- test_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict",
type = "bca")
p_value(boot)