Announcement

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

  • How to find which observation(s) is completely determined in ologit model?

    Dear Stata users,

    I fit an ordered logit regression and get a result as belows. There's only one categorical independent variable, i.e. a1, in my ologit model, and the other six independent variables are all continuous. The regression output tells me that '1 observation completely determined', I want to know how to find that observation. Firstly, is there a method to find observation(s) completely determined? and secondly, does it make sense to do that? Thank you very much.

    Code:
    . ologit depvar i.a1 a2 a3 a4 a5 a6 a7, nofvlabel
    
    Iteration 0:   log likelihood = -2580.2178  
    Iteration 1:   log likelihood = -2538.2005  
    Iteration 2:   log likelihood = -2526.1038  
    Iteration 3:   log likelihood = -2525.8926  
    Iteration 4:   log likelihood = -2525.8925  
    
    Ordered logistic regression                     Number of obs     =      1,936
                                                    LR chi2(7)        =     108.65
                                                    Prob > chi2       =     0.0000
    Log likelihood = -2525.8925                     Pseudo R2         =     0.0211
    
    ------------------------------------------------------------------------------
          depvar |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
            2.a1 |  -.0064019   .0893216    -0.07   0.943    -.1814691    .1686653
              a2 |  -.0059516   .0128652    -0.46   0.644    -.0311669    .0192638
              a3 |   .0132942    .003767     3.53   0.000     .0059109    .0206774
              a4 |  -.0286236   .0042371    -6.76   0.000    -.0369281   -.0203192
              a5 |  -1.32e-07   7.30e-07    -0.18   0.856    -1.56e-06    1.30e-06
              a6 |   .0053879   .0011111     4.85   0.000     .0032101    .0075657
              a7 |   2.45e-07   2.90e-07     0.85   0.398    -3.23e-07    8.14e-07
    -------------+----------------------------------------------------------------
           /cut1 |  -2.834941   .3529625                     -3.526735   -2.143147
           /cut2 |  -1.608988   .3376768                     -2.270823   -.9471541
           /cut3 |  -.1550939    .333416                     -.8085772    .4983894
           /cut4 |   1.879049   .3373446                      1.217866    2.540232
    ------------------------------------------------------------------------------
    Note: 1 observation completely determined.  Standard errors questionable.

  • #2
    The predicted probability should equal 0 or 1 (i.e., "completely determined").

    Code:
    webuse fullauto,clear
    foreach var in rep77 foreign length mpg{
        replace `var'=0 if inrange(_n, 19, 20)    
    }
    replace rep77=0 if rep77==1
    ologit rep77 foreign length mpg
    
    *PREDICT PROBABILITIES
    predict pr, pr
    
    *LIST COMPLETELY DETERMINED OBS
    list rep77 foreign length mpg pr if inlist(pr, 0, 1)
    Res.:

    Code:
    . ologit rep77 foreign length mpg
    
    Iteration 0:  Log likelihood = -93.659445  
    Iteration 1:  Log likelihood = -77.429021  
    Iteration 2:  Log likelihood = -76.771788  
    Iteration 3:  Log likelihood =  -76.76989  
    Iteration 4:  Log likelihood =  -76.76989  
    
    Ordered logistic regression                             Number of obs =     66
                                                            LR chi2(3)    =  33.78
                                                            Prob > chi2   = 0.0000
    Log likelihood = -76.76989                              Pseudo R2     = 0.1803
    
    ------------------------------------------------------------------------------
           rep77 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
         foreign |   2.813295   .7863676     3.58   0.000     1.272043    4.354547
          length |   .0817079   .0226624     3.61   0.000     .0372904    .1261255
             mpg |   .2297072    .070953     3.24   0.001     .0906419    .3687726
    -------------+----------------------------------------------------------------
           /cut1 |   17.70934   5.548408                      6.834657    28.58402
           /cut2 |   19.65378   5.592873                      8.691953    30.61561
           /cut3 |   21.78399   5.701291                      10.60967    32.95832
           /cut4 |   24.38912   5.887559                      12.84972    35.92853
    ------------------------------------------------------------------------------
    Note: 2 observations completely determined. Standard errors questionable.
    
    . 
    . 
    . 
    . *PREDICT PROBABILITIES
    
    . 
    . predict pr, pr
    
    . 
    . 
    . 
    . *LIST COMPLETELY DETERMINED OBS
    
    . 
    . list rep77 foreign length mpg pr if inlist(pr, 0, 1)
    
         +--------------------------------------+
         | rep77    foreign   length   mpg   pr |
         |--------------------------------------|
     19. |     0   Domestic        0     0    1 |
     20. |     0   Domestic        0     0    1 |
         +--------------------------------------+

    Comment


    • #3
      Dear Andrew Musau thank you so much. I re-run my ologit model following your guide, and find the observation. By the way, its predict probability is not exactly equal to 0 or 1, but a very small value infinitely close to 0.

      Code:
      . summarize pr, detail
      
                              Pr(depvar==1)
      -------------------------------------------------------------
            Percentiles      Smallest
       1%     .0101863       9.24e-36
       5%     .0168252       .0001392
      10%     .0191446       .0014567       Obs               1,936
      25%     .0238771       .0022248       Sum of Wgt.       1,936
      
      50%     .0305072                      Mean           .0339577
                              Largest       Std. Dev.      .0149484
      75%     .0412412       .1055237
      90%     .0527787       .1068339       Variance       .0002235
      95%     .0620009       .1313493       Skewness       1.631944
      99%      .082269       .1665727       Kurtosis       8.819085
      
      . list depvar a1 a2 a3 a4 a5 a6 a7 if pr<0.0001
      
            +---------------------------------------------------------+
            |         depvar     a1   a2   a3   a4    a5      a6   a7 |
            |---------------------------------------------------------|
       283. | Very Satisfied   Male   14   56   11   500   14375   15 |
            +---------------------------------------------------------+

      Comment


      • #4
        Edit #3. Musau is right to set 0 or 1 as standard. I simply predicted pr using the default outcome, i.e. outcome(#1). In fact, when I predict pr and specify outcome(#5), its predicted probability is equal to 1.

        Code:
        . predict pr1, pr outcome(1)
        (1,088 missing values generated)
        
        . predict pr2, pr outcome(2)
        (1,088 missing values generated)
        
        . predict pr3, pr outcome(3)
        (1,088 missing values generated)
        
        . predict pr4, pr outcome(4)
        (1,088 missing values generated)
        
        . predict pr5, pr outcome(5)
        (1,088 missing values generated)
        
        . sum pr1 pr2 pr3 pr4 pr5
        
            Variable |        Obs        Mean    Std. Dev.       Min        Max
        -------------+---------------------------------------------------------
                 pr1 |      1,936    .0339577    .0149484   9.24e-36   .1665727
                 pr2 |      1,936     .071625    .0267211   2.23e-35   .2385508
                 pr3 |      1,936    .2208742    .0510837   1.03e-34   .3479586
                 pr4 |      1,936    .4467806    .0348381   8.96e-34   .4688035
                 pr5 |      1,936    .2267624    .0799951   .0429477          1
        
        
        . list depvar a1 a2 a3 a4 a5 a6 a7 pr1-pr5 if inlist(pr5,0,1), noobs
        
          +-----------------------------------------------------------------------------------------------------------+
          |         depvar     a1   a2   a3   a4    a5      a6   a7        pr1        pr2        pr3        pr4   pr5 |
          |-----------------------------------------------------------------------------------------------------------|
          | Very Satisfied   Male   14   56   11   500   14375   15   9.24e-36   2.23e-35   1.03e-34   8.96e-34     1 |
          +-----------------------------------------------------------------------------------------------------------+

        Comment

        Working...
        X