I received the same error message when I tried to include a random coefficient on a person specific variable, in this case the intercept, with a wide dataset. The solution appears to be to (1) convert the data to the long form; (2) create alternative specific intercepts by interacting a variable equal to one for all observations with each category in the alt variable; (3) estimate a model with these new variables in the list for alternative specific variables and any other person specific variables -1 after the | line; (4) specify each of the alternative specific constant terms in the npar expression. For:
- convert the data to the long form;
- create alternative specific intercepts by interacting a variable equal to one for all observations with each category in the alt variable;
- estimate a model with these new variables in the list for alternative specific variables and any other person specific variables -1 after the | line;
- specify each of the alternative specific constant terms in the npar expression.
For the Fishing example, the long data are in fish and the mlogit command is: out<mlogit(mode~oneboat+onecharter+onepier|income-1,fish,rpar=c(oneboat="n",onecharter="n",onepier="n"),R=100,halton=NA)
out<mlogit(mode~oneboat+onecharter+onepier|income-1, fish,
rpar=c(oneboat="n",onecharter="n",onepier="n"), R=100, halton=NA)