Skip to contents

Function that takes a lavaan model with standardized paths and loadings and returns a complete lavaan model syntax with standardized variances

Usage

model_complete(m)

Arguments

m

Structural model represented by lavaan syntax

Value

character string representing lavaan model

Examples

library(simstandard)
# lavaan model
m = "
Latent_1 =~ 0.9 * Ob_11 + 0.8 * Ob_12 + 0.7 * Ob_13
Latent_2 =~ 0.9 * Ob_21 + 0.6 * Ob_22 + 0.4 * Ob_23
Latent_2 ~ 0.6 * Latent_1
"
# Same lavaan syntax, but with standardized variances
m_complete <- model_complete(m)
cat(m_complete)
#> 
#> Latent_1 =~ 0.9 * Ob_11 + 0.8 * Ob_12 + 0.7 * Ob_13
#> Latent_2 =~ 0.9 * Ob_21 + 0.6 * Ob_22 + 0.4 * Ob_23
#> Latent_2 ~ 0.6 * Latent_1
#> 
#> # Variances
#> Ob_11 ~~ 0.19 * Ob_11
#> Ob_12 ~~ 0.36 * Ob_12
#> Ob_13 ~~ 0.51 * Ob_13
#> Ob_21 ~~ 0.19 * Ob_21
#> Ob_22 ~~ 0.64 * Ob_22
#> Ob_23 ~~ 0.84 * Ob_23
#> Latent_1 ~~ 1 * Latent_1
#> Latent_2 ~~ 0.64 * Latent_2