McDonald's Omega for ESEM
omega_esem.Rd
Calculates McDonald's omega using the data inside the Lavaan object of a fitted model. The formula is the following: $$ \omega = |\sum{\lambda_i}|^2 / |\sum{\lambda_i}|^2 + \delta_i_i $$ Where \(\lambda_i\) are the factor loadings and \(\delta_i_i\), the error variances.
Arguments
- esem_model_fit
Lavaan object with an ESEM fitted model.
- target_matrix
Target rotation matrix. Usually, the same used to run esem_efa(). The names of the factors in the matrix must be exactly the same as the names in the fitted lavaan model.
Examples
#use Tucker 9 cognitive variables cov matrix
tucker <- psych::Tucker
# esem with oblique target rotation
target_mat <- make_target(9, list(f1 = c(1,2,5:7), f2 = c(3,4,8,9)))
tucker_esem_efa <- esem_efa(tucker,2,target_mat)
# fit lavaan model
referents_list <- find_referents(tucker_esem_efa, c("f2", "f1"))
model_syntax <- syntax_composer(tucker_esem_efa, referents_list)
fit <- lavaan::cfa(model_syntax, sample.cov = as.matrix(tucker), sample.nobs = 710)
# McDonald's Omega
omega_esem(fit, target_mat)
#> f1 f2
#> 0.824 0.907