2

Error Message in Random Parameter Part in gmnl code: "The following random variables are not in the data"

I'm estimating a mixed MNL model, however, the gmnl keeps giving me the error message suggesting that the random part variable is NOT in the data. But it is in the data.

My data is:

    choice ID alt RankofSubscrn DistToLastSubscrn
1.1   TRUE 1   1  -1.460        -0.684
1.2  FALSE 2   2  -1.095        -0.851
1.3  FALSE 2   3  -0.730        -1.361

My code is:

gmnl(choice ~ DistToLastSubscrn|0, 
  data = tempdata,
  model = 'mixl',
  panel = TRUE, 
  ranp = c(DistToLastSubscrn="n"))

Then it will say:

Error in gmnl(choice ~ DistToLastSubscrn | 0, data = tempdata, model = "mixl",  : 
The following random variables are not in the data:  DistToLastSubscrn

However, this variable "DistToLastSubscrn" is in my tempdata. Please help!

Zoe
  • 21
  • 1
  • [this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) would help to better reproduce the issue. – Alexey Aug 14 '19 at 08:24

1 Answers1

1

Probability you predictors are factors. Convert them into integer, the problem would be solved.

mahdi
  • 11
  • 1