0
votes

When i try to run VarSelLCM R package for latent class analysis, i get the following error:

"Error in VSLCMdataMixte(x) : At least one variable is neither numeric, integer nor factor! In addition: There were 15 warnings (use warnings() to see them)"

Here is the code i run on RStudio:

> res_with <- VarSelCluster(x, 2, nbcores = 2, initModel=40)

And here the output of the code < warnings():

> warnings()

Warning messages: 1: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 2: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 3: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 4: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 5: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 6: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 7: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 8: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 9: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 10: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 11: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 12: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 13: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 14: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length 15: In type[j] <- class(x[, j]) : number of items to replace is not a multiple of replacement length

1

1 Answers

0
votes

It is not easy to find the bug without your data. What is the output of:

summary(x)

I think that at least one of your variable does not have the right type. For instance character are not allowed.

Concerning the warnings, they inform you that some levels have a frequency of 0...