Errors 'undefined columns selected' and 'no individual index' (mlogit)

I am working with a conjoint dataset and estimating multinomial logit models. To work with the mlogit package I had to convert the data, which I did like this:

dat <-, choice="Selection_dummy", shape="long", alt.var="Alt_id", id = "Resp_id")

After converting the data, estimating the MNL model works fine. However, when I want to estimate a latent class model this provides the error that there is no individual index:

lc2<- gmnl(Selection_dummy ~ aa + ab + ba + bb + bc + ca + cb + cc + da + db + ea + eb + None | 0 | 0 | 0 | 1, data = dat, model = 'lc', Q = 2, panel = TRUE, method = "NR")

Error in gmnl(Selection_dummy ~ aa + ab + : No individual index

I think this might have to do with converting the dataset, because after converging it to work with the mlogit package, I cannot view the dataset anymore as it retrieves the following error:


Error in [.data.frame (x, start:min(NROW(x), start + len)) : undefined columns selected
Error in [.data.frame (x, start:min(NROW(x), start + len)) : undefined columns selected

I can't seem to find the issue, so does someone know what's going wrong here and how it can be solved?

Thanks a lot in advance!

See the FAQ: How to do a minimal reproducible example reprex for beginners. A question such as this is difficult to address in the abstract.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.