Error with using mlogit R function: “The two indexes don't define unique observations”
问题 My dataset look like this ID choice_situation Alternative Attr1 Attr2 Attr3 choice ID_1 1 1 0 0 0 0 ID_1 1 2 1 1 0 1 ID_1 2 1 1 1 0 0 ID_1 2 2 1 1 1 1 ID_1 3 1 2 1 0 1 ID_1 3 2 3 1 0 0 ID_2 1 1 3 0 1 1 ID_2 1 2 0 0 0 0 ID_2 2 1 2 1 1 0 ID_2 2 2 2 1 1 1 ID_2 3 1 0 0 0 1 ID_2 3 2 0 0 1 0 ..... Every time I run the code of mlogit function DCE_data<- mlogit.data(data=dataset, choice = "choice", shape = "long", alt.var = "Alternative", id.var = "ID") #ok model<- mlogit(choice ~ Attr1 + Attr2 +