View source: R/lavaan2lm_list.R
terms.lm_from_lavaan | R Documentation |
It extracts the terms
object from an lm_from_lavaan
-class
object.
## S3 method for class 'lm_from_lavaan'
terms(x, ...)
x |
An 'lm_from_lavaan'-class object. |
... |
Additional arguments. Ignored. |
A method for
lm_from_lavaan
-class that converts
a regression model for a variable in
a lavaan
model to a formula
object. This function simply calls
stats::terms()
on the formula
object to extract the predictors of a
variable.
A terms
-class object. See
terms.object for details.
terms.object,
lm_from_lavaan_list()
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)
terms(fit_list$m)
terms(fit_list$y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.