Announcement

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

  • Running model diagnostic tests using gologit2

    Hi,

    I'm using the gologit2 program in Stata to run generalised ordered logit models with partial proportional odds (using autofit). The pseudo R2 that is provided by default is the McFadden, however I would prefer to have theNagelkerke pseudo R2 (so I can compare it to some other results that I already have from a proportional odds model). Does anyone know how I can change the default setting?

    Additionally, I am also trying to run a likelihood ratio test and goodness-of-fit test (either Pearson or Deviance) on the model. Does anyone know how I can do this on a gologit2 autofit model? The fitstat command and lrtest command aren't working.

    Many thanks in advance,
    Pip

  • #2
    -gologit2- and -fitstat- are user-written commands, not part of official Stata. Without modifying their programs, there isn't a way to get the Nagelkerke R2 after -gologit2-.

    Regarding the use of -lrtest-, take a look at Example 1 in the help for -gologit2- and see if this is relevant. (It shows an example of comparing models that differ in their imposition of the proportional odds assumption.)

    Regarding the Nagelkerke R2: [set selfpromotion on]
    I'd recommend you look at the user-written (by me) command -r2o-, which implements a different and arguably better R2 measure for ordinal response models, as shown in the article cited in the help for that command. The -r2o- command has an option that will allow it to be run after commands such as -gologit2- that are not part of official Stata.
    Comparison of proportional and nonproportional odds models is one of the useful purposes of the -r2o- measure.
    [set selfpromotion off]

    Comment


    • #3
      Do you have the most current versions of gologit2 (from SSC, not Stata Journal) and spost13_ado (which has the latest version of fitstat) ? Both work fine for me.

      Code:
      . webuse nhanes2f, clear
      
      . gologit2 health weight height
      
      Generalized Ordered Logit Estimates             Number of obs     =     10,335
                                                      LR chi2(8)        =     447.41
                                                      Prob > chi2       =     0.0000
      Log likelihood = -15540.691                     Pseudo R2         =     0.0142
      
      ------------------------------------------------------------------------------
            health |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      poor         |
            weight |  -.0125667   .0026198    -4.80   0.000    -.0177014    -.007432
            height |   .0252413   .0043858     5.76   0.000     .0166454    .0338372
             _cons |  -.7262079   .6763911    -1.07   0.283     -2.05191    .5994942
      -------------+----------------------------------------------------------------
      fair         |
            weight |  -.0172167   .0016788   -10.26   0.000    -.0205071   -.0139264
            height |   .0396816   .0027561    14.40   0.000     .0342797    .0450835
             _cons |  -4.187096   .4181421   -10.01   0.000    -5.006639   -3.367552
      -------------+----------------------------------------------------------------
      average      |
            weight |   -.018172   .0015315   -11.87   0.000    -.0211736   -.0151704
            height |   .0442024   .0024304    18.19   0.000     .0394388     .048966
             _cons |  -6.173409   .3648046   -16.92   0.000    -6.888413   -5.458405
      -------------+----------------------------------------------------------------
      good         |
            weight |  -.0203431   .0019184   -10.60   0.000    -.0241031    -.016583
            height |   .0468921   .0029476    15.91   0.000      .041115    .0526692
             _cons |  -7.633728   .4391588   -17.38   0.000    -8.494463   -6.772992
      ------------------------------------------------------------------------------
      
      . fitstat
      
                               |    gologit2 
      -------------------------+-------------
      Log-likelihood           |             
                         Model |  -15540.691 
                Intercept-only |  -15764.397 
      -------------------------+-------------
      Chi-square               |             
            Deviance(df=10323) |   31081.382 
                      LR(df=8) |     447.413 
                       p-value |       0.000 
      -------------------------+-------------
      R2                       |             
                      McFadden |       0.014 
            McFadden(adjusted) |       0.013 
                  Cox-Snell/ML |       0.042 
        Cragg-Uhler/Nagelkerke |       0.044 
                         Count |       0.306 
               Count(adjusted) |       0.030 
      -------------------------+-------------
      IC                       |             
                           AIC |   31105.382 
              AIC divided by N |       3.010 
                    BIC(df=12) |   31192.301
      -------------------------------------------
      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
        Dear Richard and Mike,

        Many thanks to you both for your help. Installing the most up-to-date versions of gologit2 and spost13_ado seems to have done the trick, and fitstat is now working perfectly.

        Thank you again for your help with this matter!

        All the best,
        Pip

        Comment


        • #5
          Originally posted by Richard Williams View Post
          Do you have the most current versions of gologit2 (from SSC, not Stata Journal) and spost13_ado (which has the latest version of fitstat) ? Both work fine for me.

          Code:
          . webuse nhanes2f, clear
          
          . gologit2 health weight height
          
          Generalized Ordered Logit Estimates Number of obs = 10,335
          LR chi2(8) = 447.41
          Prob > chi2 = 0.0000
          Log likelihood = -15540.691 Pseudo R2 = 0.0142
          
          ------------------------------------------------------------------------------
          health | Coef. Std. Err. z P>|z| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          poor |
          weight | -.0125667 .0026198 -4.80 0.000 -.0177014 -.007432
          height | .0252413 .0043858 5.76 0.000 .0166454 .0338372
          _cons | -.7262079 .6763911 -1.07 0.283 -2.05191 .5994942
          -------------+----------------------------------------------------------------
          fair |
          weight | -.0172167 .0016788 -10.26 0.000 -.0205071 -.0139264
          height | .0396816 .0027561 14.40 0.000 .0342797 .0450835
          _cons | -4.187096 .4181421 -10.01 0.000 -5.006639 -3.367552
          -------------+----------------------------------------------------------------
          average |
          weight | -.018172 .0015315 -11.87 0.000 -.0211736 -.0151704
          height | .0442024 .0024304 18.19 0.000 .0394388 .048966
          _cons | -6.173409 .3648046 -16.92 0.000 -6.888413 -5.458405
          -------------+----------------------------------------------------------------
          good |
          weight | -.0203431 .0019184 -10.60 0.000 -.0241031 -.016583
          height | .0468921 .0029476 15.91 0.000 .041115 .0526692
          _cons | -7.633728 .4391588 -17.38 0.000 -8.494463 -6.772992
          ------------------------------------------------------------------------------
          
          . fitstat
          
          | gologit2
          -------------------------+-------------
          Log-likelihood |
          Model | -15540.691
          Intercept-only | -15764.397
          -------------------------+-------------
          Chi-square |
          Deviance(df=10323) | 31081.382
          LR(df=8) | 447.413
          p-value | 0.000
          -------------------------+-------------
          R2 |
          McFadden | 0.014
          McFadden(adjusted) | 0.013
          Cox-Snell/ML | 0.042
          Cragg-Uhler/Nagelkerke | 0.044
          Count | 0.306
          Count(adjusted) | 0.030
          -------------------------+-------------
          IC |
          AIC | 31105.382
          AIC divided by N | 3.010
          BIC(df=12) | 31192.301
          can this fitstat command be used when we use svy or gsvy while fitting gologit model?

          Comment


          • #6
            The easiest way to answer a question like this is just to try it and see if it works. But no, as far as I can tell, fitstat does not work after any command when svy: has been used. I think most or all of the statistics it produces are inappropriate and cannot be calculated when svy: has been used. I talk about things you can and cannot do with svy: at

            https://www3.nd.edu/~rwilliam/xsoc73...yCautionsX.pdf
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 17.0 MP (2 processor)

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

            Comment

            Working...
            X