Error using ordinal data for "model-based" bootstrapping fit indexes

75 views
Skip to first unread message

Gabriela

unread,
Mar 29, 2022, 1:13:30 PM3/29/22
to lavaan
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

Terrence Jorgensen

unread,
Mar 30, 2022, 5:17:48 AM3/30/22
to lavaan
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. 

That's because model-based transformations are applied to continuous observed data.  The way ordinal data are incorporated into SEM is to assume they are crude discretizations of normally distributed latent variables.  Because they are latent, we cannot transform them to have our model-based means/(co)variances.

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages