0

I am running a latent class analysis for choice modeling by using gmnl package. After getting my data in the right format (mlogit.data), I met the error "Error in s + x[[i]] : non-conformable arrays" when running the gmnl model.

The code of running the models is:

 lc <- gmnl(choice ~ v1 + v2 + v3 + v4 
            + v5| 0 | 0 | 0 | 1, 
           data = car, 
           model = "lc",
           Q = 3,method = 'bhhh')

The sample of my data looks like:

data sample

I have searched similar issues that other people met, I found this and this are quite related but neither of them has been addressed. Any help and hint will be highly appreciated.

Also, I would like to hear about any other useful packages that work well with latent class analysis, either a package from R or Python is fantastic! Thank you in advance.

Yaxin Cui
  • 17
  • 4

1 Answers1

1

I think the problem is that the number of alternatives isn't equal for all choicesets. That is not a problem when you use mlogit.