Hi everyone!
I am trying to run a bootstrap for the fit indexes of a CFA model with ordinal data (and WLSMV estimator) but it gives me this error:
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
The function works with the nonparametric bootstrap, but I want the Yuan bootstrap.
If I don't define my variables as ordinal, either by changing my data to factor or using the "ordered = TRUE" argument, both the Bollen-Stine and the Yuan bootstrap work.
Does anybody has found a solution?
You can replicate the error changing the data to ordinal in the example from the function documentation:
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939, se="none", ordered = T)
# get the test statistic for the original sample
T.orig <- fitMeasures(fit, "chisq")
# bootstrap to get bootstrap test statistics
T.boot <- bootstrapLavaan(fit, R=10, type="bollen.stine", ordered = TRUE, FUN=fitMeasures, fit.measures="chisq")
Best,
Gabriela