Announcement

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

  • Asclogit in Stata 14 vs Stata 13

    Dear Statalist members,

    I would appreciate your help with the following issue I encountered.

    I am using command asclogit. I used Stata 13 first. Now, I try to run same regression with the same data using Stata 14, but I noticed that there has been an important change in the asclogit command.

    In particular, same code on the same data in different versions of Stata behaves differently. While in Stata 13 regressions converge nicely in several iterations, with Stata 14 same regressions on the same data either do not converge in many non-concave iterations or sometimes we get this messsage:

    note: initial estimates failed

    command ml is unrecognized

    r(199);


    Hence, I am interested in what exactly changed between asclogit algorithm between two versions of Stata that could cause this problem.

    Or how could a user of Stata 14 call the previous version of asclogit, or what would be an equivalent command in Stata 14 for what we were doing in Stata 13?


    Was asclogit in stata 13.0 wrong? Was there a patch some time during STATA 13.0 regarding asclogit that was important?

    If I update stata 13.0 is this going to change the command asclogit to make it the way it is currently in stata 14.0?


    Please, let me know if I can provide any further clarifying details.

    Thank you so much.

    Salome Baslandze
    Last edited by Salome Baslandze; 15 Apr 2016, 14:41.

  • #2
    This is interesting and we can see the difference in the manuals for Stata 13 and 14.

    In Stata 13
    Code:
    webuse choice.dta
    asclogit choice dealer, case(id) alternatives(car) casevars(sex income)
    
    . asclogit choice dealer, case(id) alternatives(car) casevars(sex income)
    
    Iteration 0:   log likelihood = -273.55685  
    Iteration 1:   log likelihood = -252.75109  
    Iteration 2:   log likelihood = -250.78555  
    Iteration 3:   log likelihood =  -250.7794  
    Iteration 4:   log likelihood =  -250.7794  
    
    Alternative-specific conditional logit         Number of obs      =        885
    Case variable: id                              Number of cases    =        295
    
    Alternative variable: car                      Alts per case: min =          3
                                                                  avg =        3.0
                                                                  max =          3
    
                                                      Wald chi2(5)    =      15.86
    Log likelihood =  -250.7794                       Prob > chi2     =     0.0072
    Whereas in Stata 14
    Code:
    webuse choice.dta
    asclogit choice dealer, case(id) alternatives(car) casevars(sex income)
    . asclogit choice dealer, case(id) alternatives(car) casevars(sex income)
    
    Iteration 0:   log likelihood = -19907.709  (not concave)
    Iteration 1:   log likelihood = -6274.8173  (not concave)
    Iteration 2:   log likelihood = -2535.1104  
    Iteration 3:   log likelihood = -2409.6142  (backed up)
    Iteration 4:   log likelihood = -1943.5528  (backed up)
    Iteration 5:   log likelihood = -886.36617  
    Iteration 6:   log likelihood = -376.40939  
    Iteration 7:   log likelihood = -317.76085  
    Iteration 8:   log likelihood = -252.56278  
    Iteration 9:   log likelihood = -250.79858  
    Iteration 10:  log likelihood =  -250.7794  
    Iteration 11:  log likelihood =  -250.7794  
    
    Alternative-specific conditional logit         Number of obs      =        885
    Case variable: id                              Number of cases    =        295
    
    Alternative variable: car                      Alts per case: min =          3
                                                                  avg =        3.0
                                                                  max =          3
    
                                                      Wald chi2(5)    =      15.86
    Log likelihood =  -250.7794                       Prob > chi2     =     0.0072

    All the result are the same, but there is some change in maximization in Stata 14 (which is documented somewhere, I'm sure).

    If you have only case specific variables, you can look in the manual for how to run it as a multinomial logit and you might have an easier time getting convergence there (the manual shows no back ups in that output in 14). Or, you could run it as a conditional logit with interactions with the choices, but I don't know whether the changes between 13 and 14 affect clogit as well.

    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      I tried version control in Stata 14 and that did not help. You can tell from the iteration logs that Stata 13 and 14 have different ideas on what iteration 0 is. The only change I can see mentioned in the -help whatsnew- is that in Stata 14 asclogit was made to work with factor variables. I would write to Stata Tech support about it. At least for the two examples given above, any changes in the algorithms for asclogit in Stata 14 do not seem to have been for the better.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        I suggest that you contact Stata Tech as well (and let us know their response, please), but in the mean time, the following looks like a promising alternative. Run a conditional logit on the choice with attributes of the choice only, then use those estimates to initialize the asclogit.

        With the example from the manual and this procedure, I am able to get an initial likelihood much closer to the final solution resulting in fewer iterations and no "backed up" or "not concave" notices (the solution and therefore estimates are identical) in Stata 14:

        Code:
        clogit choice dealer, group(id)
        mat B=e(b)
        
        asclogit choice dealer,  alternatives(car) case(id) from(B, skip)

        asclogit results from Stata 14:
        Code:
        . asclogit choice dealer, case(id) alternatives(car) casevars(sex income) from(B, skip)
        
        Iteration 0:   log likelihood = -324.09063  
        Iteration 1:   log likelihood = -252.14028  
        Iteration 2:   log likelihood = -250.79579  
        Iteration 3:   log likelihood = -250.77941  
        Iteration 4:   log likelihood =  -250.7794  
        
        Alternative-specific conditional logit         Number of obs      =        885
        Case variable: id                              Number of cases    =        295
        
        Alternative variable: car                      Alts per case: min =          3
                                                                      avg =        3.0
                                                                      max =          3
        
                                                          Wald chi2(5)    =      15.86
        Log likelihood =  -250.7794                       Prob > chi2     =     0.0072
        Original asclogit results in Stata 13:
        Code:
        . asclogit choice dealer, case(id) alternatives(car) casevars(sex income)
        
        Iteration 0:   log likelihood = -273.55685  
        Iteration 1:   log likelihood = -252.75109  
        Iteration 2:   log likelihood = -250.78555  
        Iteration 3:   log likelihood =  -250.7794  
        Iteration 4:   log likelihood =  -250.7794  
        
        Alternative-specific conditional logit         Number of obs      =        885
        Case variable: id                              Number of cases    =        295
        
        Alternative variable: car                      Alts per case: min =          3
                                                                      avg =        3.0
                                                                      max =          3
        
                                                          Wald chi2(5)    =      15.86
        Log likelihood =  -250.7794                       Prob > chi2     =     0.0072
        Stata/MP 14.1 (64-bit x86-64)
        Revision 19 May 2016
        Win 8.1

        Comment


        • #5
          This is a bug in Stata 14 that was introduced when factor variable support was added. The problem is caused by using incorrect starting values which is why the optimization in Stata 14 starts too far off from the final solution. We will provide a fix for this in a future update. We are thankful to Salome for pointing this out and apologize for the inconvenience.

          Joerg

          Comment


          • #6
            For future reference, this apparently was fixed in the 19 May 2016 update to Stata 14.1.

            Comment

            Working...
            X