I am a psychology graduate student and I am trying to get the required statistics for my bifactor model according to APA. I was able to get the model to converge with some modifications to item loadings (there are 22 items total) using the step by Arndt Regorz. I have about 300 observations but the data may have some missing values. Any input on this would be greatly appreciated. I have copied and pasted the code I have below:
#Create a model for bifactor analysis
model_bif <- '
#Define the general factor
g =~ DTW_1 + DTW_2 + DTW_3 + DTW_6 + DTW_7 + DTW_8 + DTW_9 + DTW_10 + DTW_11 + DTW_12 + DTW_13 + DTW_14 + DTW_15 + DTW_16 + DTW_17 + DTW_18 + DTW_19 + DTW_20 + DTW_21 + DTW_22
#Define the specific factors
n =~ DTW_1 + DTW_2 + DTW_3 + DTW_4 + DTW_5 + DTW_6
m =~ DTW_7 + DTW_8 + DTW_9 + DTW_10
s =~ DTW_17 + DTW_19 + DTW_21
'
#Fit the model
fit_bif <- cfa(model_bif, data = dataset, orthogonal = TRUE)
summary(fit_bif, fit.measures = TRUE, standardized = TRUE)
#build a path diagram
semPaths(fit_bif, residuals=F,sizeMan=7,"std",
posCol=c("skyblue4", "red"),
#edge.color="skyblue4",
edge.label.cex=1.2,layout="circle2")
I have tried using the psych package but can't get the omega function to work. It continues to say "Error in m$n.obs : $ operator is invalid for atomic vectors".