Closed martscht closed 5 years ago
I think this should be resolved now:
sig <- matrix(.7, ncol = 5, nrow = 5) diag(sig) <- 1 dats <- mvtnorm::rmvnorm(200, rep(0, 5), sig) dats[sample(c(TRUE, FALSE), length(dats), TRUE, c(.2, .8))] <- NA dats <- as.data.frame(dats) names(dats) <- paste0('y', 1:5)
mod <- paste0('f =~ ', paste0('y', 1:5, collapse = ' + '))
ezCutoffs::ezCutoffs(mod, dats, n_rep = 10)
ezCutoffs::ezCutoffs(mod, dats, n_rep = 10, missing_data = 'missing')
When using listwise deletion (the lavaan default) missing data is handled incorrectly. The Problem is probably using inspect() in line 168 to determine N, which removes all missings by default, while varTable in line 221 does not. Here's a MWE: