Skip to main content
formatted
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

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:

  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 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)

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 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)

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 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)
Source Link

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 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)