coef.lm_from_lavaan function

Coefficients of an 'lm_from_lavaan'-Class Object

Coefficients of an 'lm_from_lavaan'-Class Object

Returns the path coefficients of the terms in an lm_from_lavaan-class object.

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

Arguments

  • object: A 'lm_from_lavaan'-class object.
  • ...: Additional arguments. Ignored.

Returns

A numeric vector of the path coefficients.

Details

An lm_from_lavaan-class object converts a regression model for a variable in a lavaan-class object to a formula-class object. This function simply extracts the path coefficients estimates. Intercept is always included, and set to zero if mean structure is not in the source lavaan-class object.

This is an advanced helper used by plot.cond_indirect_effects(). Exported for advanced users and developers.

Examples

library(lavaan) data(data_med) mod <- " m ~ a * x + c1 + c2 y ~ b * m + x + c1 + c2 " fit <- sem(mod, data_med, fixed.x = FALSE) fit_list <- lm_from_lavaan_list(fit) coef(fit_list$m) coef(fit_list$y)

See Also

lm_from_lavaan_list()

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