Help needed: Calculating omega and explained common variance in bifactor CFA

Hey everyone! I’m stuck with a bifactor CFA I’m doing in R. I’ve got the lavaan package running and managed to get the omega hierarchical. But I’m hitting a wall trying to figure out the regular omega and explained common variance for my 5 factors.

I tried using the psych package but no luck there either. Here’s a snippet of what I’ve got so far:

model_example <- '
General =~ Item1 + Item2 + Item3 + Item4 + Item5
Specific1 =~ Item1 + Item2
Specific2 =~ Item3 + Item4 + Item5
'

fit_example <- cfa(model_example, data = my_data, estimator = 'MLR', orthogonal = TRUE)

summary(fit_example, fit.measures = TRUE, standardized = TRUE)

# Omega hierarchical
compRelSEM(fit_example, return.total = TRUE)

When I try the omega function from psych, I get an error:

omega(model_example, 3, n.obs = 500)
# Error: $ operator is invalid for atomic vectors

Any ideas what I’m doing wrong or how to adjust my model? Thanks in advance!

hey there creativechef15! looks like ur having some trouble with that bifactor CFA. have u tried using the semTools package? it’s got some neat functions for omega and ECV calculations. might wanna check out the reliabilityL2 function. it can handle bifactor models pretty well. good luck with ur analysis!

I’ve encountered similar issues with bifactor CFA in R. One approach that worked for me was using the semTools package, specifically the reliabilityL2 function. It’s designed to handle bifactor models and can calculate both omega and ECV.

Here’s a basic example of how you might use it:

library(semTools)

reliability <- reliabilityL2(fit_example)
omega_total <- reliability$omega.tot
ecv <- reliability$ecv

print(paste('Omega Total:', omega_total))
print(paste('ECV:', ecv))

This should give you the omega total and ECV values you’re looking for. Make sure your model is properly specified as a bifactor model in lavaan syntax. If you’re still having trouble, double-check your data structure and model specification. Hope this helps!