Announcement

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

  • Too Few Categories Problem

    Hi,

    I am trying to run a mlogit regression using "Status" as my dependent variable, status has 3 outcomes 1=in school 2=working 3=Not in either, independent variables "wage" and an identifier variable "id" when I try to regress this using "mlogit status i.id wage, baseoutcome (1)", STATA gives me an error r(148) "too few categories", and I can't understand why/how to fix, can anyone please help?

    Thanks

  • #2
    Looks like you only have one category in status. Can you post what you get when you type

    Code:
     tab status

    Comment


    • #3
      see attached screenshot, it looks ok, there. After playing around if I removed the wage variable it worked, but Im not sure why that would be. Thanks for the help.
      Attached Files

      Comment


      • #4
        I suppose that wage is observable for only those individuals who work. If you have missing values for wage when status is equal to 1 or 2, change them to zero and re-run the estimation with wage. It should work.

        Here is an illustration

        Code:
        . clear
        
        . webuse sysdsn1
        (Health insurance data)
        
        . tab insure
        
             insure |      Freq.     Percent        Cum.
        ------------+-----------------------------------
          Indemnity |        294       47.73       47.73
            Prepaid |        277       44.97       92.69
           Uninsure |         45        7.31      100.00
        ------------+-----------------------------------
              Total |        616      100.00
        
        . gen premium= 100 if insure==1
        (350 missing values generated)
        
        . mlogit insure age male nonwhite i.site premium
        
        note: premium omitted because of collinearity
        too few categories
        r(148);
        
        
        . replace premium=0 if premium==.
        (350 real changes made)
        
        . mlogit insure age male nonwhite i.site premium
        
        Iteration 0:   log likelihood = -555.85446  
        Iteration 1:   log likelihood = -142.57969  
        Iteration 2:   log likelihood =  -126.0916  
        Iteration 3:   log likelihood = -123.10222  
        Iteration 4:   log likelihood =   -122.375  
        Iteration 5:   log likelihood = -122.24066  
        Iteration 6:   log likelihood = -122.21004  
        Iteration 7:   log likelihood = -122.20259  
        Iteration 8:   log likelihood = -122.20106  
        Iteration 9:   log likelihood = -122.20073  
        Iteration 10:  log likelihood = -122.20066  
        Iteration 11:  log likelihood = -122.20064  
        Iteration 12:  log likelihood = -122.20064  
        
        Multinomial logistic regression                   Number of obs   =        615
                                                          LR chi2(12)     =     867.31
                                                          Prob > chi2     =     0.0000
        Log likelihood = -122.20064                       Pseudo R2       =     0.7802
        
        ------------------------------------------------------------------------------
              insure |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        Indemnity    |  (base outcome)
        -------------+----------------------------------------------------------------
        Prepaid      |
                 age |     .00079   89.06307     0.00   1.000    -174.5596    174.5612
                male |  -.0121135   2939.865    -0.00   1.000    -5762.041    5762.017
            nonwhite |   .0252292   3378.219     0.00   1.000    -6621.162    6621.212
                     |
                site |
                  2  |   .1737362   3119.245     0.00   1.000    -6113.433    6113.781
                  3  |   .0000592    3220.04     0.00   1.000    -6311.162    6311.162
                     |
             premium |  -.4144542   27.25635    -0.02   0.988    -53.83591      53.007
               _cons |    20.4515   4847.597     0.00   0.997    -9480.665    9521.568
        -------------+----------------------------------------------------------------
        Uninsure     |
                 age |   .0017614   89.06307     0.00   1.000    -174.5586    174.5622
                male |  -.0677585   2939.865    -0.00   1.000    -5762.097    5761.961
            nonwhite |  -.7480398   3378.219    -0.00   1.000    -6621.935    6620.439
                     |
                site |
                  2  |  -1.126736   3119.245    -0.00   1.000    -6114.734     6112.48
                  3  |   .4313781    3220.04     0.00   1.000    -6310.731    6311.593
                     |
             premium |  -.4109094   44.11962    -0.01   0.993    -86.88377    86.06196
               _cons |    18.9896   4847.597     0.00   0.997    -9482.127    9520.106
        ------------------------------------------------------------------------------
        Last edited by Andrew Musau; 02 Feb 2016, 11:09.

        Comment


        • #5
          Hi, having the same issue here. Replacing "." with "0" doesn`t help though. Using Stata 14. Any idea what might be going on anyone? Many thanks in advance!!
          Code:
          mlogit

          Comment


          • #6
            Your description is not sufficient to know whether your problem is similar to #1. Please review the FAQs and post exactly what you typed and the resulting Stata output in its entirety. Enclose this within CODE delimiters.

            Comment

            Working...
            X