Function that takes a lavaan model with standardized parameters and returns a model-implied correlation matrix

get_model_implied_correlations(
  m,
  observed = TRUE,
  latent = FALSE,
  errors = FALSE,
  factor_scores = FALSE,
  composites = FALSE,
  ...
)

Arguments

m

Structural model represented by lavaan syntax or output of sim_standardized_matrices function.

observed

Include observed variables

latent

Include latent variables

errors

Include observed error and latent disturbances variables

factor_scores

Include factor score variables

composites

Include composite variables

...

parameters passed to the `sim_standardized_matrices` function

Value

A correlation matrix

Examples

library(simstandard)
# lavaan model
m = "Latent_1 =~ 0.8 * Ob_1 + 0.7 * Ob_2 + 0.4 * Ob_3"

get_model_implied_correlations(m)
#>      Ob_1 Ob_2 Ob_3
#> Ob_1 1.00 0.56 0.32
#> Ob_2 0.56 1.00 0.28
#> Ob_3 0.32 0.28 1.00