I would like to run a multi logit model in R. The data has been transformed using the mlogit.data() function.
dt1 = mlogit.data(dt, choice = "Buy", shape = "long", chid.var = "Id",
alt.levels = c("model1","model2","model3","model4"))
But when I later run the multi logit model using mlogit()
mlogit(Buy~norRebate,data=dt1)
An error shows up as:
Error in parse(text = x, keep.source = FALSE) :
<text>:2:0: unexpected end of input
1: . ~ . |
^
But the dt1 is okay if I run it using gmnl(). What's wrong with the code or data format when I run it using mlogit() and what's the difference running multi logit model between mlogit() and gmnl()?