I am using the mlogit package in R and trying to run mlogit on the Train dataset that is available in the package. Here is my code:
mlogit.data(Train,shape='wide',choice = "choice", varying = 4:11, sep = "",alt.levels = c(1,2), id = "id")
I get the following error:
Error in
[<-.data.frame
(*tmp*
, , v.names, value = c(2400, 2400, 2400, : column name "" cannot match any column In addition: Warning message: In dfidx::dfidx(data = data, dfa$idx, drop.index = dfa$drop.index, : the levels shouldn't be provided with a data set in wide format
I am not sure where is the mistake here.