coef.lm_from_lavaan: Coefficients of an 'lm_from_lavaan'-Class Object

View source: R/lavaan2lm_list.R

coef.lm_from_lavaanR Documentation

Coefficients of an 'lm_from_lavaan'-Class Object

Description

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

Usage

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

Arguments

object

A 'lm_from_lavaan'-class object.

...

Additional arguments. Ignored.

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.

Value

A numeric vector of the path coefficients.

See Also

lm_from_lavaan_list()

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)


manymome documentation built on Oct. 4, 2024, 5:10 p.m.