When using the reliability function of semTools (Version: 0.5-2) with imputed categorial data, I get the following error message. For illustration see the Example below:
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
#create missings and ordinal data
set.seed(20170110)
HSMiss <- HolzingerSwineford1939[,paste("x", 1:9, sep="")]
randomMiss <- rbinom(prod(dim(HSMiss)), 1, 0.1)
randomMiss <- matrix(as.logical(randomMiss), nrow=nrow(HSMiss))
HSMiss[randomMiss] <- NA
HSMiss.ord <- as.data.frame( lapply(HSMiss, cut, 5, labels=FALSE) )
# Imputation with mice and create list of imputations
imp<-mice(HSMiss.ord, m=5)
nImputations <- 5
impList <- list()
for (i in 1:nImputations) {
impList[[i]] <- complete(imp, action = i)
}
#run cfa.mi
cfa.ord<-cfa.mi(HS.model, impList, estimator = "WLSMV", ordered=names(HSMiss.ord) )
reliability(cfa.ord)
Error in if (any(lower > upper)) stop("lower>upper integration limits") :
missing value where TRUE/FALSE needed