coef.test_mediation: Coefficients in (robust) mediation analysis

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coef.R

Description

Extract coefficients from models computed in (robust) mediation analysis.

Usage

1
2
3
4
5
6
7
8
9
## 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 "test_mediation" containing results from (robust) mediation analysis, or an object inheriting from class "fit_mediation" containing a (robust) mediation model fit.

parm

an integer, character or logical vector specifying the coefficients to be extracted, or NULL to extract all coefficients.

...

additional arguments are currently ignored.

type

a character string specifying whether to extract the means of the bootstrap distribution ("boot"; the default), or the coefficient estimates based on the full data set ("data").

Value

A numeric vector containing the requested coefficients.

Author(s)

Andreas Alfons

See Also

test_mediation, fit_mediation, confint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
test <- test_mediation(fit)
coef(test, type = "data")  # from orignal sample
coef(test, type = "boot")  # means of bootstrap replicates

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