I am now trying to do mlogit and I have taken some references in mlogit.data: data.frame for logit model in mlogit: Multinomial Logit Models (rdrr.io). However, I think these examples doesn't fit my model.
For example, My model has travelers, each of them has a rank, but the rank is just based on the number of shop and scenery (and other variables), but not a specific place (line 2 and line 4 is not the same place).
Traveler | Fav Rank | Shop | Scenery |
1 | 1 | 2 | 4 |
1 | 2 | 1 | 2 |
2 | 1 | 4 | 5 |
2 | 2 | 7 | 3 |
So I want to get the rank based on the variables, should I use mlogit.data? If yes, how can I correct my code?
mdata <- mlogit.data(data=data,
//alt.levels = c("plane", "train", "bus", "car"), # I am not sure whether to delete it or not, as my model doesn't bound to 4 specific methods