add_paths {tidySEM} | R Documentation |
Add paths to an object of class 'tidy_sem'
Description
Add paths to an object of class tidy_sem
, or replace
existing paths. The paths must be specified as
model.syntax
, and separated by commas.
Usage
add_paths(model, ...)
Arguments
model |
An object of class |
... |
Paths to add or substitute, specified in
|
Details
Currently, only the lavaan{lavaan}
commands ~,
~~, =~,
and ~1
are parsed.
This function
relies on lavaan model.syntax
to convert syntax strings
to lavaan
parameter tables. By default, is uses the arguments
int.ov.free = TRUE, int.lv.free = FALSE, auto.fix.first = TRUE,
auto.fix.single = TRUE, auto.var = TRUE, auto.cov.lv.x = TRUE,
auto.efa = TRUE, auto.th = TRUE, auto.delta = TRUE, auto.cov.y = TRUE,
meanstructure = TRUE
, in a similar way
to sem
and cfa
.
Value
An object of class tidy_sem
.
See Also
Examples
library(lavaan)
df <- iris[, 1:4]
names(df) <- paste0("x_", 1:4)
model <- tidy_sem(df)
model <- measurement(model)
model <- add_paths(model, x =~ a*x_1 + b*x_2 + a*x_3 + b*x_4)
res <- estimate_lavaan(model)
summary(res)
[Package tidySEM version 0.2.7 Index]