Announcement

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

  • spost13, possibly other user-written post-estimation commands, partially zapped by Stata 15 (for now)

    Just a heads up: Stata 15 changes the format of some ereturned results. This can zap some user-written commands, e,g. some of Long and Freeses's popular spost13 commands (findit spost13_ado). For example,

    Code:
    . webuse nhanes2f, clear
    
    . quietly ologit health weight i.female i.black
    
    . brant
    variable cut1 not found
    r(111);
    Luckily there is a simple solution. Just use version control with the estimation command:

    Code:
    webuse nhanes2f, clear
    version 14.2: quietly ologit health weight i.female i.black
    brant
    Long and Freese are working on a fix so that version control will not be necessary.

    In general, if some user-written post-estimation command stops working in Stata 15, try using version control with the estimation command.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

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

  • #2
    Thanks very much Richard - I just created an account to post a question about this exact problem
    Note that this fix also addresses the same issue with the 'oparallel' command.

    Comment


    • #3
      It appears that there have been some possibly-general changes in v15 regarding the naming conventions of so-called "ancillary" parameters.

      Prompted by Richard's comment in #1 and my posting yesterday (https://www.statalist.org/forums/for...tion-since-v13) I ran an ordered-probit model using -oprobit- in v13 and v15 and noticed that the -cut- parameters returned in -e(b)- are now named differently in the two versions.

      If this change is fundamentally important to the operation of v15, then that's all well and good and life goes on. If not, I wonder if Stata could consider building an option that could be set so that alternative naming conventions could be available "permanently" to users wanting to recover -e(...)- results.

      Comment


      • #4
        Stata Tech said "We needed this new free-parameter syntax in the design of latent class analysis." Scott Long thinks the change is a good one but programs will need to adapt.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

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

        Comment


        • #5
          I have tried to use the command you have provided to overwrite the problem in stata 15 with the use of the brant command. Nevertheless is doesnt work. the error returned is:


          Any idea what I am doing wrong?

          Comment


          • #6
            Sorry, I think the image does not show in the previous post. I hope that it does in this one.
            Attached Files

            Comment


            • #7
              Aaaaand me again with the solution: I didnt install the spost13_ado. I have done so now and, of course, its does work. Apologies for the unnecessary spamming of this post

              Comment


              • #8
                Works for me. Make sure Stata and spost13 are up to date.

                Code:
                . webuse nhanes2f, clear
                
                . version 14.2: quietly ologit health weight i.female i.black
                
                . brant
                
                Brant test of parallel regression assumption
                
                              |       chi2     p>chi2      df
                 -------------+------------------------------
                          All |      41.69      0.000       9
                 -------------+------------------------------
                       weight |       6.46      0.091       3
                     1.female |      35.66      0.000       3
                      1.black |       5.86      0.119       3
                
                A significant test statistic provides evidence that the parallel
                regression assumption has been violated.
                The current version of brant is

                Code:
                . which brant
                c:\ado\plus\b\brant.ado
                *! version 4.0.0 2017-08-23 | long freese | stata 15 parameter naming fix
                If you have the most current version of spost13_ado, you don't need version anymore anyway, as the problem has been fixed.

                Make sure you have the version of brant that comes with spost13_ado. Other older versions are around, and that causes problems if you use them. Do

                Code:
                findit spost13_ado
                EDIT: crossed with Isabel's post.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                Stata Version: 17.0 MP (2 processor)

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

                Comment


                • #9
                  Dear community,

                  I am not sure whether to open a new post, because my problem is very much related to this I think:

                  After I run my ologit model, I would like to test whether it fulfills the parallel regression assumption.

                  While the omodel command works, I would like to see which variables in particular violate the assumption.

                  Code:
                  omodel logit generalecon salesprofit credithis capital bankcred
                  
                  [Iteration omitted]
                  
                  Ordered logit estimates                           Number of obs   =     105526
                                                                    LR chi2(4)      =   45444.12
                                                                    Prob > chi2     =     0.0000
                  Log likelihood = -89182.425                       Pseudo R2       =     0.2030
                  
                  ------------------------------------------------------------------------------
                  generaleco~y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                   salesprofit |   1.306096   .0107325   121.70   0.000     1.285061    1.327132
                     credithis |   .1254899    .012237    10.25   0.000     .1015057     .149474
                       capital |   .1527547   .0116794    13.08   0.000     .1298636    .1756458
                      bankcred |   1.020393   .0107048    95.32   0.000     .9994123    1.041374
                  -------------+----------------------------------------------------------------
                         _cut1 |  -.8182717   .0079362          (Ancillary parameters)
                         _cut2 |   1.848961   .0096588
                  ------------------------------------------------------------------------------
                  
                  Approximate likelihood-ratio test of proportionality of odds
                  across response categories:
                           chi2(4) =    777.09
                         Prob > chi2 =    0.0000
                  However, after running the ologit, the brant and the oparallel command do not work.

                  Instead, I get these error messages:

                  Code:
                  . brant, detail
                  - invalid name
                  1 invalid name
                  and

                  Code:
                  . oparallel
                  equation [cut1] not found
                  I have tried to find some solution in related threads, but did not come across any solution. I am using Stata 15 and have the latest version of spost13_ado. Oddly, When I try the example that was suggested by Richard Williams, the brant command works fine.

                  Does anyone have a solution?

                  Comment


                  • #10
                    What you show is omodel, not ologit. omodel runs an old version of ologit. So run ologit instead. If problems persist, write back.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

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

                    Comment


                    • #11
                      Here is a sequence of commands that works fine for me. Note the need to have version control right.

                      Code:
                      use auto.dta, clear
                      * Should work fine in Stata 15
                      omodel logit rep78 mpg weight
                      * In Stata 15, need to rerun ologit if we want to use brant
                      ologit rep78 mpg weight
                      brant, detail
                      * In Stata 15, need to run ologit with version control to use oparallel
                      version 14: ologit rep78 mpg weight
                      oparallel
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      Stata Version: 17.0 MP (2 processor)

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

                      Comment


                      • #12
                        Dear Richard,

                        Thanks so much for the prompt reply!

                        What you show is omodel, not ologit. omodel runs an old version of ologit. So run ologit instead. If problems persist, write back.
                        I am sorry that I was not clear: I first tried the omodel, and then I ran the exact same regression with ologit in order to use the brant and oparallel tests.

                        What I tried in the mean time is to run your gologit2 command with the autofit option (and then the npl/pl options). This should do the job as well, doesn't it?

                        Thanks again for your help! It is always very much appreciated!

                        Carsten

                        Comment


                        • #13
                          gologit2 does provide an alternative to the brant test, and indeed oparallel builds in a gologit test. But you should be able to get brant and oparallel to work. Does my code in #11 work for you? If not, what errors are you getting? If yes, what are you doing differently?

                          My standard advice is to run

                          Code:
                          update all
                          adoupdate
                          If you are lucky, the problem has already been fixed. But if problems persist, post your code and output so we can see exactly what you are doing, e.g. something like

                          Code:
                          ologit y x1 x2 x3
                          brant, detail
                          version 14: ologit y x1 x2 x3
                          oparallel
                          -------------------------------------------
                          Richard Williams, Notre Dame Dept of Sociology
                          Stata Version: 17.0 MP (2 processor)

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

                          Comment


                          • #14
                            Thanks Richard!

                            Oddly the code in #11 works. But for my regression I get error messages.
                            When I run update all and adoupdate, I get the following error messages:

                            Code:
                             update all
                            (contacting http://www.stata.com)
                            
                            downloading utility files ...         connection timed out -- see help r(2) for troubleshooting
                            r(2);
                            Code:
                             adoupdate
                            (note: adoupdate updates user-written files; type -update- to check for updates to official Stata)
                            
                            Checking status of installed packages...
                            
                                [1] logout at http://fmwww.bc.edu/repec/bocode/l:
                            
                            server refused to send file
                                             fopen():   672  server refused to send file
                                     loadsscupfile():     -  function returned error
                             pkg_update_status_ssc():     -  function returned error
                                 pkg_update_status():     -  function returned error
                            pkg_update_status_noisily():     -  function returned error
                             extract_update_exists():     -  function returned error
                                pkg_chk_and_update():     -  function returned error
                                             <istmt>:     -  function returned error
                            r(672);
                            Nevertheless, the problem persists and therefore I am posting what I did:

                            This is the error I get for the brant test:

                            Code:
                            . ologit  generalecon salesprofit credithis capital bankcred
                            
                            Iteration 0:   log likelihood = -111904.49
                            Iteration 1:   log likelihood = -89883.262
                            Iteration 2:   log likelihood = -89185.742
                            Iteration 3:   log likelihood = -89182.425
                            Iteration 4:   log likelihood = -89182.425
                            
                            Ordered logistic regression                     Number of obs     =    105,526
                                                                            LR chi2(4)        =   45444.12
                                                                            Prob > chi2       =     0.0000
                            Log likelihood = -89182.425                     Pseudo R2         =     0.2030
                            
                            --------------------------------------------------------------------------------
                            generaleconomy |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            ---------------+----------------------------------------------------------------
                               salesprofit |   1.306096   .0107325   121.70   0.000     1.285061    1.327132
                                 credithis |   .1254899    .012237    10.25   0.000     .1015057     .149474
                                   capital |   .1527547   .0116794    13.08   0.000     .1298636    .1756458
                                  bankcred |   1.020393   .0107048    95.32   0.000     .9994123    1.041374
                            ---------------+----------------------------------------------------------------
                                     /cut1 |  -.8182717   .0079362                     -.8338264    -.802717
                                     /cut2 |   1.848961   .0096588                       1.83003    1.867891
                            --------------------------------------------------------------------------------
                            
                            . brant, detail
                            - invalid name
                            1 invalid name
                            r(7);
                            The oparallel works fine, but I cannot see which variables in particular violate the parallel regression assumption.

                            Code:
                            . version 14: ologit  generalecon salesprofit credithis capital bankcred
                            
                            Iteration 0:   log likelihood = -111904.49
                            Iteration 1:   log likelihood = -89883.262
                            Iteration 2:   log likelihood = -89185.742
                            Iteration 3:   log likelihood = -89182.425
                            Iteration 4:   log likelihood = -89182.425
                            
                            Ordered logistic regression                     Number of obs     =    105,526
                                                                            LR chi2(4)        =   45444.12
                                                                            Prob > chi2       =     0.0000
                            Log likelihood = -89182.425                     Pseudo R2         =     0.2030
                            
                            --------------------------------------------------------------------------------
                            generaleconomy |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            ---------------+----------------------------------------------------------------
                               salesprofit |   1.306096   .0107325   121.70   0.000     1.285061    1.327132
                                 credithis |   .1254899    .012237    10.25   0.000     .1015057     .149474
                                   capital |   .1527547   .0116794    13.08   0.000     .1298636    .1756458
                                  bankcred |   1.020393   .0107048    95.32   0.000     .9994123    1.041374
                            ---------------+----------------------------------------------------------------
                                     /cut1 |  -.8182717   .0079362                     -.8338264    -.802717
                                     /cut2 |   1.848961   .0096588                       1.83003    1.867891
                            --------------------------------------------------------------------------------
                            
                            . oparallel
                            
                            Tests of the parallel regression assumption
                            
                                             |   Chi2     df  P>Chi2
                            -----------------+----------------------
                                 Wolfe Gould |  777.1      4   0.000
                                       Brant |  640.6      4   0.000
                                       score |  806.9      4   0.000
                            likelihood ratio |  807.6      4   0.000
                                        Wald |  811.3      4   0.000
                            What about the autofit option in gologit? Does it do the same trick as the brant test?

                            Thanks in advance!

                            Carsten
                            Last edited by Carsten Preuss; 27 Jun 2018, 08:16.

                            Comment


                            • #15
                              Yes, you can use gologit. But again, you shouldn't be having the problems you are having. Do you always have problems with -update all- and adoupdate? If not, then it may be a temporary glitch and you can try again later. But if this always happens, check with your network administrator. This is a minor nuisance now but it could become a major problem if you can't update anything.

                              These commands tell you what versions you have of Stata and brant and oparallel. You should get something similar.

                              Code:
                              . update query
                              (contacting http://www.stata.com)
                              
                              Update status
                                  Last check for updates:  27 Jun 2018
                                  New update available:    none         (as of 27 Jun 2018)
                                  Current update level:    06 Jun 2018  (what's new)
                              
                              Possible actions
                              
                                  Do nothing; all files are up to date.
                              
                              . which brant
                              c:\ado\plus\b\brant.ado
                              *! version 4.0.0 2017-08-23 | long freese | stata 15 parameter naming fix
                              
                              . which oparallel
                              c:\ado\plus\o\oparallel.ado
                              *! version 1.0.8 21Okt2013 MLB
                              *!
                              *! subroutines for the Wolfe-Gould test based on:
                              *!   -omodel- version 1.0.1  26Sep1997  Rory Wolfe and Bill Gould  STB-42 sg76 
                              *!
                              *! subroutines for the Brant test based on:
                              *!   -brant- version 1.6.0 3/29/01 by J. Scott Long and Jeremy Freese
                              
                              .
                              -------------------------------------------
                              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