coef.test_mediation {robmed} | R Documentation |
Coefficients in (robust) mediation analysis
Description
Extract coefficients from models computed in (robust) mediation analysis.
Usage
## S3 method for class 'test_mediation'
coef(object, parm = NULL, ...)
## S3 method for class 'boot_test_mediation'
coef(object, parm = NULL, type = c("boot", "data"), ...)
## S3 method for class 'fit_mediation'
coef(object, parm = NULL, ...)
Arguments
object |
an object inheriting from class |
parm |
an integer, character or logical vector specifying the
paths for which to extract coefficients, or |
... |
additional arguments are currently ignored. |
type |
a character string specifying whether to extract the means
of the bootstrap distribution ( |
Value
A numeric vector containing the requested coefficients.
Author(s)
Andreas Alfons
See Also
test_mediation()
, fit_mediation()
,
confint()
, p_value()
Examples
data("BSG2014")
# fit robust mediation model and extract coefficients
fit <- fit_mediation(BSG2014,
x = "ValueDiversity",
y = "TeamCommitment",
m = "TaskConflict")
coef(fit)
# run fast-and-robust bootstrap test and extract coefficients
boot <- test_mediation(fit)
coef(boot, type = "data") # from original sample
coef(boot, type = "boot") # means of bootstrap replicates