Hello,
I'm conducting a cfa to test a six factor structure of aquestionnaire, four Items are loading on each factor. The Items shows a five-point likert scale, I consider them as ordered. To handle the Missings I'm conducting a Multiple Imputation with the R-Package mice. The following Codes dosen't work:
#Specifing Imputation-Model
eltern.imp.pmm<-mice(Eltern_ek, pri=F, m=1, maxit = 0)
eltern.imp.pmm$predictorMatrix
pred.eltern.pmm<-eltern.imp.pmm$predictorMatrix
pred.eltern.pmm[,"id"]<-0
pred.eltern.pmm
meth.eltern.pmm<-eltern.imp.pmm$meth
meth.eltern.pmm["sex.x"]<-""
meth.eltern.pmm
Eltern.imp.pmm<-mice(Eltern_ek, method=meth.eltern.pmm, pred=pred.eltern.pmm, m=5, maxit=5, pri=F, seed= 12345)
#Running cfa
imps.mice<-list()
for(i in 1:5) imps.mice[[i]]<-complete(Eltern.imp.pmm, action=i)
Model<-'F1=~Item11+Item12+Item13+Item14
F2=~Item21+Item22+Item32+Item42
F3~Item31+Item32+Item33+Item34
F4=~ Item41+Item42+Item43+Item44
F5=~ Item51+Item52+Item53+Item54
F6=~ Item61+Item62+Item63+Item64'
cfa.fit<-cfa.mi(, data=imps.mice, ordered=names(Eltern_ek),estimator = "WLSMV", mimic="MPlus")
I get the following error:
Error in colMeans(do.call(rbind, coefList)) :
'x' must be an array of at least two dimensions
Without Specifing the Imputation-Model, the Code works fine. It would be great if anyone has an idea to solve the problem. Thanks!
Best Regards
Sebastian