This convenience function runs objects for which a method exists
using lavaan. It is intended for use with
tidySEM
, and passes the $syntax
and $data
elements of a
tidy_sem
object on to lavaan
.
run_lavaan(x, ...)
Returns a lavaan object.
df <- iris[1:3]
names(df) <- paste0("X_", 1:3)
run_lavaan(measurement(tidy_sem(df), meanstructure = TRUE))
#> Warning: lavaan->lav_object_post_check():
#> some estimated ov variances are negative
#> lavaan 0.6-19.2139 ended normally after 82 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 9
#>
#> Number of observations 150
#>
#> Model Test User Model:
#>
#> Test statistic 0.000
#> Degrees of freedom 0