Announcement

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

  • Average Marginal Effects with unlabeled data using cmmixlogit/ cmxtmixlogit

    Dear Statalist,

    I have unlabeled data from a discrete choice experiment. I am estimating a mixed logit model with the 'cmxtmixlogit' command.

    Code:
    cmset id choice_set alternative
    cmxtmixlogit choice x_1, random(i.x_2 i.x_3 i.x_4 i.x_5 i.x_6 i.x_7, normal) nocons intp(100)
    After having estimated the model I want to obtain Average Marginal Effects for the fixed (x_1) and random coefficients (x_2 - x_7) in my model.

    For this I use margins, dydx(*) after estimating the model.

    Code:
    . margins, dydx(x_1)
    
    Average marginal effects                        Number of obs     =      9,540
    Model VCE    : OIM
    
    Expression   : Pr(alternative), predict()
    dy/dx w.r.t. : x_1
    
    ----------------------------------------------------------------------------------------
                           |            Delta-method
                           |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -----------------------+----------------------------------------------------------------
    x_1|
    _outcome#alternative|
                      1 1  |   .0133838   .0004739    28.24   0.000      .012455    .0143125
                      1 2  |  -.0066778    .000239   -27.94   0.000    -.0071463   -.0062093
                      1 3  |   -.006706   .0002349   -28.54   0.000    -.0071664   -.0062455
                      2 1  |  -.0066778    .000239   -27.94   0.000    -.0071463   -.0062093
                      2 2  |   .0133483   .0004728    28.23   0.000     .0124216    .0142751
                      2 3  |  -.0066705    .000234   -28.51   0.000    -.0071291   -.0062119
                      3 1  |   -.006706   .0002349   -28.54   0.000    -.0071664   -.0062455
                      3 2  |  -.0066705    .000234   -28.51   0.000    -.0071291   -.0062119
                      3 3  |   .0133765   .0004688    28.53   0.000     .0124576    .0142954
    ----------------------------------------------------------------------------------------
    What Stata gives me is the change in probability for each of the alternatives, given the outcomes. These results allow me to make a statement about how changing say x_1 changes the probability to choose an alternative, given that we observe a specific outcome. E.g. given we observe outcome 1, a change in x_1 decreases the probability to pick alternative 2 by -.0066778.

    However, as I use unlabeled data, you can see that the results are in a way redundant, because the alternatives in unlabeled data have no meaning in itself. Therefore it does not matter which outcome and alternative I consider. Changing to another alternative, is essentially the same for each outcome.

    What I would like to have is an estimate for how changing x_1 changes the overall probability to choose an alternative, not a specific one.

    Is there a way to do this with the margins command?

    Help is much appreciated.

    Best
    Marius
    Last edited by Marius Berger; 21 May 2020, 11:34. Reason: average marginal effects, AME, margins, choice models, cmmixlogit, cmxtmixlogit, mixed logit, discrete choice

  • #2
    Hi Marius

    Have you found a solution to this issue? I am in a similar situation and also have not found a way to solve this yet.

    Best
    Joelle

    Comment


    • #3
      Hi Marius!

      I am having the same issue with unlabeled DCE results. Have you found a solution?

      Regards
      Felix

      Comment


      • #4
        Hi all,

        a potentially useful solution, depending on your model, is to generate a new price attribute where one of the unlabeled alternatives keeps its original prices and the other one is set at a price so high that its probability is 0 (the price of the status quo is also unchanged). You can use the new price variable with the at() option in margins. From that point onwards, you are essentially comparing one unlabeled alternative and the status quo which, together, attract all choices.

        Hope this helps.
        Matteo

        Comment


        • #5
          A possible solution for the indicator variables when there are two choice alternatives, e.g. if interested in margins, at(x_2=(0,1)), is the following:

          1. Store estimation results
          2. Create new data set or new choice sets: one choice set for each effect (e.g. newchoiceset1: set x_2 of alternative 1 to 0 and of alternative 2 to 1, set other attributes for example to the mean)
          3. Use stored estimation results, margins if choiceset=newchoiceset1
          4. Take difference of the two choice probabilities

          This is straightforward if there are only alternative-specific variables. Careful in the creation of the new data set when there are individual-specific variables.

          Comment

          Working...
          X