Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running Mixed Logit Models with > 20 Random Coefficients

    Hi there,

    I'm trying to run a Mixed Logit Model using the user written mixlogit command of the form:

    mixlogit choice_variable , rand(random_coefficient1 random_coefficient2....) group(choice_id) id(individual_id)

    However, I have 28 coefficients I would like to specify as random in my data set, and consequently when I try to run the model I get the error message:

    maximum dimension is 20
    r(3200);


    I was just wondering if anyone knew if there was a way around this user the mixlogit command, or if there was another command available that I could use to run this type of model with > 20 random coefficients?

    I've had a look around at some of the Stata resource available online and some other forums and not found an answer for this thus far. Apologies if I've missed something very obvious!

    Best wishes,

    Tom

  • #2
    That is a lot of random coefficients; I expect you will have trouble no matter what tricks you try. Have you tried -melogit-?

    Comment


    • #3
      Hi Jeph,

      Thanks for your response. I'll have another look at melogit.

      Yep, as you state it is a lot. If I can't find a way round I'll simply reduce the number.

      Best wishes,

      Tom

      Comment


      • #4
        Tom Robinson:

        I have not tried it out but I think the following approach should work.

        Arne Risa Hole wrote a related command, -gmnl- which has the -mixl- option that allows you to estimate the same model specification as -mixlogit-. See -ssc install gmnl- and -help gmnl-. Once you have downloaded -gmnl-, you can type a command line like -gmnl depvar, rand(indepvars) group(varname1) id(varname2) nrep(500) mixl dtype(3)- to accommodate more than 20 random coefficients.

        The key "trick" here is the undocumented option -dtype(3)- which asks -gmnl- to use uniform random number draws rather than Halton draws. The reason why -mixlogit- (and for that matter, -gmnl- without -dtype(3)-) gives you that error message is because it uses Mata's -halton()- function which does not allow more than 20 different sequences. -gmnl, dtype(3)- uses Mata's -uniform()- function which does not have this kind of constraint. Not being able to use Halton sequences is not necessarily a bad thing as far as a mixed logit application is concerned: several studies, including Bhat (2003; https://doi.org/10.1016/S0191-2615(02)00090-5), find that Halton draws don't perform well when you have a large number of random coefficients.

        Comment


        • #5
          Thanks Hong Il Yoo, I'll have a look at that!

          Best wishes,

          Tom

          Comment

          Working...
          X