Hi lavaan group - I’ve been working my way through some psychometric analyses of a new tool we are developing in the sports sciences and I’ve been spinning my wheels a bit on an error I get when trying to obtain indicator reliability on our 3-factor CFA model using lavaan and multiply imputed datasets. I would like to rely on the compRelSEM function in SEMtools but am struggling to get output from my lavaan.mi object. As far as I can tell, my error occurs when trying to pull the variances from the @phiList. When looking at the @phiList, it appears as though the covariance matrices are accurate for all imputations. The error is as follows:
Error in PHI[[block.label[b]]] <- Reduce("+", lapply(phiList, "[[", i = b))/m :
attempt to select less than one element in OneIndex
If I run each of the imputed datasets separately through compRelSEM I can get estimates. But I'm struggling with the pooled estimates. Any help or guidance would be appreciated.
# Define the CFA model
model3a <- '
# Factor indicators
Factor1 =~ social1 + social2 + social3 +social4 + social5 + social6
Factor2 =~ motivation1 + motivation3 + motivation10+ motivation11+ motivation12
Factor3 =~ physical1 + physical4+physical5
# Factor covariances
Factor1 ~~ Factor2
Factor1 ~~ Factor3
Factor2 ~~ Factor3
# run lavaan and imputation in one step
fittedmodel <- runMI(model3a,
data=data,
m = 5,
miPackage="mice",
fun="cfa",
estimator="DWLS",
se="robust",
test="scaled.shifted",
meanstructure = TRUE)
#summary
summary(fittedmodel, fit.measures=TRUE, standardized=TRUE)
#Indicator Reliability
compRelSEM(fittedmodel, tau.eq=FALSE)
Error in PHI[[block.label[b]]] <- Reduce("+", lapply(phiList, "[[", i = b))/m :
attempt to select less than one element in OneIndex