Running the Mlogit function does not work, because it says that the two indexes(Resp_id & Alternative_id) are not unique. I have twelve times the same ID, because each respondent got 12 choice options with 3 alternatives.
> cbc_mlogit <- mlogit.data(thesis,
+ choice = "Selection", # Choice variable
+ shape = "long", # Convert to long format
+ alt.var = "Alternative_id", # Alternative ID variable
+ id.var = "Resp_id") # Respondent ID variable
Error: Error in dfidx::dfidx(data = data, dfa$idx, drop.index = dfa$drop.index, :
the two indexes don't define unique observations
Dataset looks like this
Desired output: get partworth utilities
I tried to make Resp_id and Alternative_id a character (now numeric), but still the same issue