Announcement

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

  • Brant test for parallel regression lines dependent on coding of dependent variable

    I estimate an ordinal logistic regression model and use 'oparallel' to get the p-value from a Brant test:

    webuse fullauto,clear

    ologit rep77 foreign

    oparallel, brant


    This returns a chi2-value of 926 and a p-value of 0.000.

    Now, recoding the dependent variable as:

    recode rep77 (1=5) (2=4) (4=2) (5=1), gen(rep77_2)

    and running

    ologit rep77_2 foreign

    oparallel, brant


    returns a chi2-value of -3396 and a p-value of 1.000.

    This surely has a perfectly reasonable explanation, but i wonder if someone would care to explain to me exactly what is going on here?



  • #2
    You cannot switch categories arbitrarily in an ordinal scale, as you can in a nominal scale. Therefore, there is no reason to wonder why results of the Brant test differ. oparallel is from SSC by Maarten Buis (FAQ Advice #12).

    Comment


    • #3
      Looking at #1 carefully, you are reversing the scale and not arbitrary changing the categories, which is reasonable. The Brant test should therefore yield the same test statistic and P value. The issue here, however, is that that some categories in rep77 are not observed over all levels of foreign. The implementation in Long and Freese's spost13 package (net install spost13_ado) will not output a result in this instance and will exit with the following error:

      Code:
      . webuse fullauto,clear
      (Automobile Models)
      
      . ologit rep77 foreign
      
      Iteration 0:   log likelihood = -89.895098  
      Iteration 1:   log likelihood = -85.951765  
      Iteration 2:   log likelihood = -85.908227  
      Iteration 3:   log likelihood = -85.908161  
      Iteration 4:   log likelihood = -85.908161  
      
      Ordered logistic regression                     Number of obs     =         66
                                                      LR chi2(1)        =       7.97
                                                      Prob > chi2       =     0.0047
      Log likelihood = -85.908161                     Pseudo R2         =     0.0444
      
      ------------------------------------------------------------------------------
             rep77 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
           foreign |   1.455878   .5308951     2.74   0.006     .4153425    2.496413
      -------------+----------------------------------------------------------------
             /cut1 |  -2.765562   .5988208                     -3.939229   -1.591895
             /cut2 |  -.9963603   .3217706                     -1.627019   -.3657016
             /cut3 |   .9426153   .3136398                      .3278925    1.557338
             /cut4 |   3.123351   .5423257                      2.060412     4.18629
      ------------------------------------------------------------------------------
      
      . brant, detail
      option rhs_beta() required
      r(198);
      The oparallel command will execute as you illustrate, but this will result in what you show (different results when reversing scales). If we make the categories balanced

      Code:
           Repair |
      Record 1977 |      Freq.     Percent        Cum.
      ------------+-----------------------------------
             Poor |          2        4.44        4.44
             Fair |         10       22.22       26.67
          Average |         20       44.44       71.11
             Good |         13       28.89      100.00
      ------------+-----------------------------------
            Total |         45      100.00
      
      -----------------------------------------------------------------------------------------------------------------------------------------
      -> foreign = Foreign
      
           Repair |
      Record 1977 |      Freq.     Percent        Cum.
      ------------+-----------------------------------
             Poor |          1        4.76        4.76
             Fair |          1        4.76        9.52
          Average |          7       33.33       42.86
             Good |          7       33.33       76.19
        Excellent |          5       23.81      100.00
      ------------+-----------------------------------
            Total |         21      100.00
      by deleting the category rep77=Excellent, then both programs will give consistent results with the scales reversed.

      Code:
      webuse fullauto,clear
      drop if rep77==5
      qui ologit rep77 foreign
      oparallel, brant
      qui ologit rep77 foreign
      brant, detail
      recode rep77 (1=4) (2=3) (3=2) (4=1), gen(rep77_2)
      qui ologit rep77_2 foreign
      oparallel, brant
      qui ologit rep77_2 foreign
      brant, detail
      Res.:

      Code:
      . webuse fullauto,clear
      (Automobile Models)
      
      . 
      . drop if rep77==5
      (5 observations deleted)
      
      . 
      . qui ologit rep77 foreign
      
      . 
      . oparallel, brant
      
      Test of the parallel regression assumption
      
                       |   Chi2     df  P>Chi2
      -----------------+----------------------
                 Brant |  1.693      2   0.429
      
      . 
      . qui ologit rep77 foreign
      
      . 
      . brant, detail
      
      Estimated coefficients from binary logits
      
      -----------------------------------------------
          Variable |  y_gt_1     y_gt_2     y_gt_3   
      -------------+---------------------------------
           foreign |   -0.360      0.934      0.649  
                   |    -0.29       1.13       1.08  
             _cons |    3.068      1.012     -0.901  
                   |     4.24       3.00      -2.74  
      -----------------------------------------------
                                          legend: b/t
      
      Brant test of parallel regression assumption
      
                    |       chi2     p>chi2      df
       -------------+------------------------------
                All |       1.69      0.429       2
       -------------+------------------------------
            foreign |       1.69      0.429       2
      
      A significant test statistic provides evidence that the parallel
      regression assumption has been violated.
      
      . 
      . recode rep77 (1=4) (2=3) (3=2) (4=1), gen(rep77_2)
      (61 differences between rep77 and rep77_2)
      
      . 
      . qui ologit rep77_2 foreign
      
      . 
      . oparallel, brant
      
      Test of the parallel regression assumption
      
                       |   Chi2     df  P>Chi2
      -----------------+----------------------
                 Brant |  1.693      2   0.429
      
      . 
      . qui ologit rep77_2 foreign
      
      . 
      . brant, detail
      
      Estimated coefficients from binary logits
      
      -----------------------------------------------
          Variable |  y_gt_1     y_gt_2     y_gt_3   
      -------------+---------------------------------
           foreign |   -0.649     -0.934      0.360  
                   |    -1.08      -1.13       0.29  
             _cons |    0.901     -1.012     -3.068  
                   |     2.74      -3.00      -4.24  
      -----------------------------------------------
                                          legend: b/t
      
      Brant test of parallel regression assumption
      
                    |       chi2     p>chi2      df
       -------------+------------------------------
                All |       1.69      0.429       2
       -------------+------------------------------
            foreign |       1.69      0.429       2
      
      A significant test statistic provides evidence that the parallel
      regression assumption has been violated.
      
      .
      You should ask @Marteen Buis to look into this.
      Last edited by Andrew Musau; 19 Sep 2021, 08:26.

      Comment


      • #4
        Both programs are indicating there is a problem but not being very clear about what is causing it. The -3396 Chi-square from oparallel is pretty bizarre. The error message from brant is also uninformative. It is one of those errors caused by other errors. Things like that will happen because programmers often don’t anticipate everything that can go wrong.

        with ologit, rather than drop categories with small n, it may be better to combine some adjacent categories. If ologit is a legitimate method for the problem then combining some adjacent categories should be fine.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

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

        Comment

        Working...
        X