I am trying to setup my data for the mlogit-package in R, but somehow I get an error message even though the exact demand with the same data worked before.
My data-frame is called data.02.alt, and it looks like this:
It can be described as the following:
.
When I rund the command
MC <- mlogit.data(data.02.alt, choice = "choice",shape = "long", id.var = "case.id", alt.var = "Mode", group.var = "Hous_Loc")
I always get the error message
Error in `row.names<-.data.frame`(`*tmp*`, value = paste(chid, alt, sep = ".")) :
duplicate 'row.names' are not allowed
In addition:
non-unique values when setting 'row.names': ‘100344.Bike’, ‘100344.PT’, ‘100345.Car’, ‘100345.Walk’, ‘100409.Bike’, ‘100409.PT’...
Could anyone tell me what I am doing wrong here? Could be the problem that I only have on alternative specific variable (com.cost)? I have read the help-documentation of mlogit, and read similar topics here on stackowerflow but without success, since after applying the advice it still didn't work.
Thanks in advance :),
Victoria