Announcement

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

  • errors in mlogtest, iia

    Dear all, I am estimating several multinomial logits, one for each different country, but all the rest equal. The dependent variable has 5 outcomes.
    When estimating the model for one of the countries, the Hausman tests and the suest-based Hausman tests ran normally but the Small-Hsiao tests issued the error basecategory not found r(111).
    When estimating the model for another country, the suest-based Hausman tests lead to the error equation _OrigNewBase_No_pq_formal___informal not found r(303). No_pq_formal___informal is one of the outcomes, not the reference outcome.
    I do not understand why I receive these error messages and I have no idea of what I should do! I tried to find an answer in previous posts in the forum but did not find any.
    I would be very grateful if I could get some help on this.

  • #2
    mlogtest is from the Spost13 website and is authored by Long and Freese. This was a long shot, but it replicates your error.

    Code:
    webuse sysdsn1, clear
    *THIS IS OK
    mlogit insure age male nonwhite i.site
    mlogtest, iia
    *THIS REPLICATES YOUR ERROR
    lab list
    lab def insure 2 "No_pq_formal___informal", modify
    mlogit insure age male nonwhite i.site
    mlogtest, iia
    Res.:

    Code:
    . mlogtest, iia
    
    Hausman tests of IIA assumption (N=615)
    
      Ho: Odds(Outcome-J vs Outcome-K) are independent of other alternatives
    
                     |      chi2    df   P>chi2
    -----------------+-------------------------
            Indemnit |     0.100     6    1.000
            No_pq_fo |    -1.323     6        .
            Uninsure |    -0.442     6        .
    
      Note: A significant test is evidence against Ho.
      Note: If chi2<0, the estimated model does not meet asymptotic assumptions.
    
    suest-based Hausman tests of IIA assumption (N=615)
    
      Ho: Odds(Outcome-J vs Outcome-K) are independent of other alternatives
    equation _OrigNewBase_No_pq_formal___informal not found
    r(303);
    In summary, long variable names (in this case, long value labels) can cause problems, especially in community-contributed commands which are not as widely used as official commands and therefore there is less chance of catching bugs.

    Code:
    . di length("No_pq_formal___informal")
    23
    Try modifying the long value labels and see if this solves it.
    Last edited by Andrew Musau; 09 Mar 2021, 16:24.

    Comment


    • #3
      Dear Andrew, it worked, thank you soo much! It indeed happened that I created these labels in the file with data for the second country, whereas I had not created them in the first file that I used. That is why the error only appeared when estimating the model with data for the second country. The solution was simple but it had not occurred to me. You were so helpful, discovering the source of this error!
      The other error that occurs - Small-Hsiao tests issued the error basecategory not found r(111) - continues to happen. It happened with the datasets for both countries. You wouldn't happen to have also a bright idea about its cause?

      Comment


      • #4
        It appears that this is caused by how your outcome is ordered. Try to group the categories, tracking which is which.

        Code:
        webuse sysdsn1, clear
        *THIS IS OK
        mlogit insure age male nonwhite i.site
        mlogtest, smhsiao
        *THIS PRODUCES THE ERROR
        replace insure=0 if insure==1
        mlogit insure age male nonwhite i.site
        mlogtest, smhsiao
        Res.:

        Code:
        . mlogtest, smhsiao
        
        Small-Hsiao tests of IIA assumption (N=615)
        
          Ho: Odds(Outcome-J vs Outcome-K) are independent of other alternatives
        basecategory not found
        r(111);
        There is no need to modify the ado here, just create a new variable using the -group()- function of egen.

        Code:
        webuse sysdsn1, clear
        *THIS PRODUCES THE ERROR
        replace insure=0 if insure==1
        mlogit insure age male nonwhite i.site
        mlogtest, smhsiao
        egen outcome= group(insure)
        tab insure outcome
        lab def outcome 1 "Indemnity" 2 "Prepaid" 3 "Uninsure"
        lab values outcome outcome
        mlogit outcome age male nonwhite i.site
        mlogtest, smhsiao
        Res.:

        Code:
        . mlogtest, smhsiao
        
        Small-Hsiao tests of IIA assumption (N=615)
        
          Ho: Odds(Outcome-J vs Outcome-K) are independent of other alternatives
        
                         | lnL(full)  lnL(omit)       chi2    df        
        -----------------+-----------------------------------------------
               Indemnity |   -62.457    -58.630      7.654     6    0.265
                 Prepaid |   -67.291    -65.375      3.832     6    0.699
                Uninsure |  -180.535   -177.204      6.662     6    0.353
        
          Note: A significant test is evidence against Ho.

        Comment


        • #5
          Dear Andrew, again you were right. Your suggestion solved the problem. Many, many thanks!

          Comment

          Working...
          X