Announcement

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

  • xtmlogit for varying choice set

    Hi,

    I have posted the question at cross validated, but I have not got any answer yet, so I repost here to seek help.
    After reading more, I think I should rephrase the question:

    I have panel data. Subjects have different choice sets at different time, so I assume I should not use -xtmlogit- which only allows for fixed choice set.
    My question is whether there is any way in Stata that I can do multinomial logit with varying choice set, and whether it is proper to use -cmxtmixlogit- panel data mixed multinomial logit in such case given that it relaxed IIA assumption.


    I am using Stata 17. I am also willing to try some other software if needed.

    Thanks

  • #2
    UPDATE:

    I have tried -cmxtmixlogit-, and this is my choice set summary and some note:

    Code:
    Tabulation of choice-set possibilities
    
     Choice set |      Freq.     Percent        Cum.
    ------------+-----------------------------------
            1 2 |      4,664       52.05       52.05
          1 2 3 |      3,853       43.00       95.06
            2 3 |        443        4.94      100.00
    ------------+-----------------------------------
          Total |      8,960      100.00
    
    
    
    note: alternatives are unbalanced.
    But when I run the command, it actually does not drop any obs due to unbalanced alternatives.
    I am wondering how the command deals with such unbalanced alternatives. Is it different from the case with balanced alternatives?

    Comment


    • #3
      I have not used either -xtmlogit- or -cmxtmixlogit-, but I have thought I would share with you what I have picked up from reading the Stata PDF manual entries for those two commands and what I know about the properties of multinomial/conditional logit models in general.

      -xtmlogit- is a special case of -cmxtmixlogit-, much as -mlogit- is a special case of -clogit-. You can use -cmxtmixlogit- to reproduce -xtmlogit-, just as you can use -clogit- to reproduce -mlogit-. But the two families of commands (-clogit- and -cmxtmixlogit- on one hand, and -mlogit- and -xtmlogit- on the other) have different data structure requirements. You must re-organise your data set in light of these differences: See, for example, this note by Lee Adkins: https://www.learneconometrics.com/cl...ic%20Logit.pdf.

      If you open the PDF entry and look at the log-likelihood function of -cmxtmixlogit- (for that matter, -clogit- too), you will notice that nothing in the formula requires that every choice set has exactly the same number of alternatives. If some choice sets include two alternatives, the conditional logit kernel can be defined over those two alternatives. If some choice sets include three alternatives, the conditional logit kernel can be defined over those three alternatives.

      Comment


      • #4
        Hong Il Yoo
        Thanks for the advice!

        I have been playing around with -xtmlogit- and -cmxtmixlogit- without alternative specific variable.

        When I have balanced alternatives, i.e., action a, b and c, the two command mostly give the similar results, though the estimates are slightly different.
        When I have unbalanced alternatives, i.e., coded action 1, 2 and 3, the two command give different estimates for example, one independent variable of interest becomes insignificant using mixed logit, even with opposite sign compared to -xtmlogit-.


        Does it mean I should follow the mixed logit results as it accounts for varying alternative set? But the Hausman test does not reject IIA under -xtmlogit-.
        Last edited by Jasmine Xu; 16 Jul 2021, 09:47.

        Comment


        • #5
          Some more on what I want to do:

          I want to check if nn (treatment variable) has effect on coded options, in particular, does it have positive effect on 2 and negative effect on 1, give the twoway table results below.
          Code:
          xtmlogit coded i.nn x1 x2, vce(cluster session)
          -xtmlogit- gives expected results in terms of marginal effect.
          Code:
          cmxtmixlogit codedchosen, casevars(i.nn x1 x2) vce(cluster session)
          -cmxtmixlogit- gives both negative marginal effect on 1 and 2, so I am really confused by the results.

          btw, x1 and x2 are related to nn, so have to add them into regression.

          Code:
          #panel structure
                               nn
            coded    |      0             1 |     Total
          -----------+----------------------+----------
                   1 |       784        558 |     1,342
                   2 |       242        519 |       761
                   3 |     3,454      3,403 |     6,857
          -----------+----------------------+----------
               Total |     4,480      4,480 |     8,960
          Last edited by Jasmine Xu; 16 Jul 2021, 12:43.

          Comment


          • #6
            Jasmine Xu: Applying the Hausman test of IIA to -xtmlogit- is like applying the Breusch-Pagan test of heteroskedasticity to LPM. You know that -xtmlogit- does not display IIA by construction, much as you know that LPM is heteroskedastic by construction. Provided that you have organised your data set correctly and set up the command lines correctly, the discrepancy between -xtmlogit- and -cmxtmixlogit- in the "unbalanced" case must come from the fact that -xtmlogit- incorrectly assumes that the full set of alternatives {1, 2, 3} are available in every choice scenario.

            I'm afraid that I can't answer your second question on the basis of the information you have provided. If you share your full output with reasonably detailed explanations about your research context, one of us in this form may be able to say something more helpful.

            Comment

            Working...
            X