Announcement

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

  • Issue with dummy variables in mixlogit

    Hello,

    I am trying to estimate the mixlogit using the below syntax:

    mixlogit choice distance fac_type alt_dum*, rand(oop) group(case_id)

    where oop, distance, and fac_type are alternative-specific variables and I would like a random coefficient for the variable oop.
    In addition, I also include dummies for alternatives, in the alt_dum* variables. When I run this, I receive the error message:
    "At least one variable has been specified to have both fixed and random coefficients"
    Could anyone please help explain why I had this error message?

    The syntax works fine without the alternative dummies, or without all the alternative dummies.

    Any help is very much appreciated.

    Many thanks,
    Yen.

  • #2
    Yen

    You cannot include a dummy for each alternative in the model - you need to leave one out for identification purposes.

    That error message suggests that you don't have the most recent version of mixlogit installed - type "ssc install mixlogit, replace" in Stata to update the command.

    Arne

    Comment


    • #3
      I found your documentation, Hole (2007) extremely helpful as I am using the mixlogit function with dummy variables but am having an issue others have posted about regarding the correct format for categorical explanatory variables. It is described below, and I include an example of my dataset and commands/error I receive from STATA MP 17

      I had come across a post regarding using the MLM with dummy variables with a choice set in the long format (each respondent is presented 4 choice sets, 2 options with 1 alternative specific variable or buy-no for a total of 3 options) and was unable to run this due to the dummy variables being the same across the rows where each respondent sequence ID is across 12 rows. The dummy variables in my dataset are: clam consumer; WTP; MSC; ASC.

      Generate user_gid = 100*seqid + choiceset

      mixlogit choice, group(user_gid) id(seqid) rand(source_sc mehtod_aq wtp msc asc price buyno) nrep(50)

      *Variable wtp has no within-group variance

      This makes sense as I am trying to use my entire sample with this dummy variable that does not vary across the sequence ID. It is a quick fix, I am just having trouble reformatting to run this command. Thank you for any guidance you may have.
      Attached Files

      Comment

      Working...
      X