coef.indirect_proportion function

Extract the Proportion of Effect Mediated

Extract the Proportion of Effect Mediated

Return the proportion of effect mediated in the output of indirect_proportion().

## S3 method for class 'indirect_proportion' coef(object, ...)

Arguments

  • object: The output of indirect_proportion()
  • ...: Not used.

Returns

A scalar: The proportion of effect mediated.

Details

It extracts and returns the element proportion in the input object.

Examples

library(lavaan) dat <- data_med head(dat) mod <- " m ~ x + c1 + c2 y ~ m + x + c1 + c2 " fit <- sem(mod, dat, fixed.x = FALSE) out <- indirect_proportion(x = "x", y = "y", m = "m", fit = fit) out coef(out)

See Also

indirect_proportion()

  • Maintainer: Shu Fai Cheung
  • License: GPL (>= 3)
  • Last published: 2025-01-25