Warning messages:1: In pc_cor_TS(fit.y1 = FIT[[i]], fit.y2 = FIT[[j]], method = optim.method, ... :lavaan WARNING: empty cell(s) in bivariate table of i2 x i1
Error in cat(list(...), file, sep, fill, labels, append) :argument 2 (type 'S4') cannot be handled by 'cat'
Error in cat(list(...), file, sep, fill, labels, append) :argument 2 (type 'S4') cannot be handled by 'cat'
I've not seen this previously, does anyone know yet what the cause of this is?
example(cfa)cat("This is my output", fit)
install.packages("lavaan", repos = "http://www.da.ugent.be", type = "source")
library(foreign)
fm <- read.dta()
fm[,c("PHLMS_1", "PHLMS_3", "PHLMS_5", "PHLMS_7", "PHLMS_9", "PHLMS_11", "PHLMS_13", "PHLMS_15", "PHLMS_17", "PHLMS_19", "PHLMS_2R", "PHLMS_4R", "PHLMS_6R", "PHLMS_8R", "PHLMS_10R", "PHLMS_12R", "PHLMS_14R", "PHLMS_16R", "PHLMS_18R", "PHLMS_20R")] <- lapply(fm[,c("PHLMS_1", "PHLMS_3", "PHLMS_5", "PHLMS_7", "PHLMS_9", "PHLMS_11", "PHLMS_13", "PHLMS_15", "PHLMS_17", "PHLMS_19", "PHLMS_2R", "PHLMS_4R", "PHLMS_6R", "PHLMS_8R", "PHLMS_10R", "PHLMS_12R", "PHLMS_14R", "PHLMS_16R", "PHLMS_18R", "PHLMS_20R")], ordered)
library(lavaan)
model1 <- '
# latent variable definitions
ACCEPT =~ PHLMS_2R + PHLMS_4R + PHLMS_6R + PHLMS_8R + PHLMS_10R + PHLMS_12R + PHLMS_14R + PHLMS_16R + PHLMS_18R + PHLMS_20R
AWARE =~ PHLMS_1 + PHLMS_3 + PHLMS_5 + PHLMS_7 + PHLMS_9 + PHLMS_11 + PHLMS_13 + PHLMS_15 + PHLMS_17 + PHLMS_19'
fit1 <- sem(model1, data = fm)
summary(fit1, standardized = TRUE, fit.measures = TRUE, modindices = TRUE)
It only happens if I treat the data as categorical - so seems tied up with the zero cell counts issue.