62775084

Date: 2020-07-07 13:20:23
Score: 7
Natty:
Report link

I've got the same problem. My dataset looks like this

personID    caseID   altID    choice   a1    a2    a3    a4  
   1          1        1         1      3     0     3     1
   1          1        2         0      1     3     0     1
   1          1        3         0      4     4     4     4
   1          2        1         0      2     2     1     3
   1          2        2         1      2     3     1     3
etc....

I've tried running the following code, performing the model.

setV2 <- mlogit.data(data = setV2, choice = "choice", shape = "long", alt.var = "altID", chid.var = "personID")
m <- mlogit(choice ~ a1 + a2 + a3 + a4 | -1, rpar = c(a1 = "n", a2 = "n", a3 = "n", a4 = "n"), correlation = FALSE, halton = NA, TM)

However, I receive the same error (after the first line of code), as presented below:

Error in dfidx::dfidx(data = data, dfa$idx, drop.index = dfa$drop.index,  : 
  the two indexes don't define unique observations

Does any of you have an idea what's going wrong? Thanks in advance.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (3): Thanks in advance
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2): the same problem
  • Me too answer (2): the same error
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Michael Otten