coef.lm_from_lavaan {manymome}R 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)


[Package manymome version 0.2.1 Index]