Announcement

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

  • Error: cannot compute an improvement -- discontinuous region encountered

    Good night,

    I am trying to perform a probit ordered model with panel data and the following error appears: cannot compute an improvement -- discontinuous region encountered

    Do anybody know how to solve this error and what does it means?

    Thanks!
    Laura

  • #2
    Unfortunately, it means your model won't converge. Maximum likelihood has failed. Errors of that type are frustrating because the thing that causes them is often different in different cases. You may need to simplify the model.

    Comment


    • #3
      Laura:
      welcome to this forum.
      Please note that, we such scant details, Jonathan's helpful reply is the best that we can get.
      In this instance, the usual fix is to start from scratch, add one predictor at a time and see when Stata starts gasping.
      Please follow the FAQ when posting and share what you typed and what Stata gave you back.
      If you think (as some occasional posters do) that following the FAQ is time-consuming, please note that is much more time-consuming posting and reposting the same thread with increasing details reported in each new message due to the lack of positive replies. Thanks.
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment


      • #4
        Firstly, thanks to Jonathan and Carlo for your answers. I apologise myself for not using adequately the forum. As it was the first time using it and did not know how to proceed. Sorry. I hope to be more clear now. I have a model where the dependent variable measures a firm policty whose values rank from an inadequate policy (1) to exceptional policy (5).

        I have used this model in Stata v15 and the error commented yesterday appears:

        xtoprobit dependiente260nueva f1_eco_soc_tec_pol f2_env sector_ans260 sector_reverte answer245nueva answer359 answer338nueva size variacion_valor answer78 yr2013c-yr2016c

        note: yr2016c omitted because of collinearity

        Fitting comparison model:

        Iteration 0: log likelihood = -8863.2782
        Iteration 1: log likelihood = -7163.5615
        Iteration 2: log likelihood = -7139.5889
        Iteration 3: log likelihood = -7139.5392
        Iteration 4: log likelihood = -7139.5392

        Refining starting values:

        Grid node 0: log likelihood = -6035.6631

        Fitting full model:

        Iteration 0: log likelihood = -6035.6631
        cannot compute an improvement -- discontinuous region encountered
        r(430);

        end of do-file

        Today, following your suggestion I have estimated models only considering the dependent variable and each explanatory variable separately as a first step. And in all cases, the same error appears. So, it is not possible to estimate anything even considering in a independent way each variable.


        I only paste some examples, as with all variables happens the same:

        xtoprobit dependiente260nueva f1_eco_soc_tec_pol

        Fitting comparison model:

        Iteration 0: log likelihood = -8863.2782
        Iteration 1: log likelihood = -8861.5915
        Iteration 2: log likelihood = -8861.5915

        Refining starting values:

        Grid node 0: log likelihood = -7481.1461

        Fitting full model:

        Iteration 0: log likelihood = -7481.1461
        cannot compute an improvement -- discontinuous region encountered
        r(430);

        end of do-file

        r(430);

        . do "C:\Users\Usuario\AppData\Local\Temp\STD2210_0 0000 0.tmp"

        . xtoprobit dependiente260nueva f2_env

        Fitting comparison model:

        Iteration 0: log likelihood = -8863.2782
        Iteration 1: log likelihood = -8821.9803
        Iteration 2: log likelihood = -8821.9719
        Iteration 3: log likelihood = -8821.9719

        Refining starting values:

        Grid node 0: log likelihood = -7444.1152

        Fitting full model:

        Iteration 0: log likelihood = -7444.1152
        cannot compute an improvement -- discontinuous region encountered
        r(430);

        end of do-file

        r(430);

        Something similar happens also if I used xtologit instead of xtoprobit.

        Thanks in advance, and best regards,
        Last edited by Laura Cabeza; 31 Jan 2022, 12:52.

        Comment


        • #5
          Laura:
          could you please provide an example/excerpt of your dataset via -dataex- (see the FAQ)? Thanks.
          That said, as you surmised, the problem seems to rest on the regressand.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            I have reading this point 12.2 What to say about your data of FAQ and type ssc install dataex in my Stata. And the write 'dataex dependiente260nueva' (dependiente260nueva is the dependent variable which seems to have the problem). I am not sure if you refer to this.

            The following appear in stata:

            dataex dependiente260nueva

            ----------------------- copy starting from the next line -----------------------
            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input float dependiente260nueva
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            2
            4
            4
            4
            3
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            5
            5
            5
            5
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            1
            1
            4
            4
            4
            4
            5
            5
            5
            5
            4
            4
            4
            4
            4
            4
            4
            4
            5
            4
            4
            4
            4
            4
            4
            4
            3
            3
            3
            3
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            4
            end
            ------------------ copy up to and including the previous line ------------------

            Listed 100 out of 6705 observations
            Use the count() option to list more


            *** And the same information by company:

            dataex company_id dependiente260nueva

            ----------------------- copy starting from the next line -----------------------
            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input int company_id float dependiente260nueva
              3 4
              3 4
              3 4
              3 4
              6 4
              6 4
              6 4
              6 4
             13 4
             13 4
             13 4
             13 4
             16 4
             16 4
             16 4
             18 4
             18 4
             18 4
             18 4
             28 4
             28 4
             28 4
             28 4
             29 2
             29 4
             29 4
             29 4
             31 3
             31 4
             31 4
             31 4
             32 4
             32 4
             32 4
             32 4
             38 4
             38 4
             38 4
             38 4
             41 4
             41 4
             41 4
             41 4
             43 5
             43 5
             43 5
             43 5
             45 4
             45 4
             45 4
             53 4
             53 4
             53 4
             53 4
             78 4
             78 4
             78 4
             78 4
             80 1
             80 1
             93 4
             93 4
             93 4
             93 4
             96 5
             96 5
             96 5
             96 5
             98 4
             98 4
             98 4
             98 4
            102 4
            102 4
            102 4
            102 4
            105 5
            105 4
            105 4
            105 4
            107 4
            107 4
            107 4
            107 4
            119 3
            119 3
            119 3
            119 3
            130 4
            130 4
            130 4
            130 4
            131 4
            131 4
            131 4
            131 4
            132 4
            132 4
            132 4
            132 4
            end
            ------------------ copy up to and including the previous line ------------------

            Listed 100 out of 6705 observations
            Use the count() option to list more

            Last edited by Laura Cabeza; 31 Jan 2022, 13:39.

            Comment


            • #7
              Laura:
              you're on the right track.
              However, interested listers need at least a predictor.
              Eventually, the -timevar- would not harm, too.
              Thanks.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Good morning, Carlo. I have run dataex with the company variable, the year variable, the dependent variable, and 2 predictors. Both are in lagged values and there is a possible endogeneity problem with them (for this reason for them no values in 2013 appears):

                dataex company_id year dependiente260nueva sector_ans260_1 f2_env_1

                ----------------------- copy starting from the next line -----------------------
                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input int(company_id year) float(dependiente260nueva sector_ans260_1 f2_env_1)
                  3 2013 4      .        .
                  3 2014 4 2.4359  -.13596
                  3 2015 4   2.25  -.12736
                  3 2016 4  2.275  -.13341
                  6 2013 4      .        .
                  6 2014 4 2.1308  -.74878
                  6 2015 4 2.1471  -.76785
                  6 2016 4  2.049  -.95268
                 13 2013 4      .        .
                 13 2014 4 1.5192  -.13596
                 13 2015 4  1.434  -.12736
                 13 2016 4 1.6078  -.13341
                 16 2013 4      .        .
                 16 2014 4  2.086  -.13596
                 16 2015 4 2.0805  -.12736
                 18 2013 4      .        .
                 18 2014 4  2.086  -.29758
                 18 2015 4 2.0805  -.33368
                 18 2016 4 2.1839  -.29843
                 28 2013 4      .        .
                 28 2014 4 1.7563  -.58434
                 28 2015 4 1.6905  -.66139
                 28 2016 4 1.6615    -.621
                 29 2013 2      .        .
                 29 2014 4 2.2647   -.3133
                 29 2015 4    2.4  -.30741
                 29 2016 4 2.4151  -.25386
                 31 2013 3      .        .
                 31 2014 4 2.0388  -.74878
                 31 2015 4 1.9806  -.76785
                 31 2016 4 1.8509  -.95268
                 32 2013 4      .        .
                 32 2014 4  1.931  -.74785
                 32 2015 4 2.0484  -.67952
                 32 2016 4 2.0645  -.65397
                 38 2013 4      .        .
                 38 2014 4 2.0291  -.13596
                 38 2015 4 1.9806  -.12736
                 38 2016 4 1.8509  -.13341
                 41 2013 4      .        .
                 41 2014 4 1.7563  -.13596
                 41 2015 4 1.6905  -.12736
                 41 2016 4 1.6615  -.13341
                 43 2013 5      .        .
                 43 2014 5 2.5922  -.29758
                 43 2015 5 2.5728  -.33368
                 43 2016 5 2.6214  -.29843
                 45 2013 4      .        .
                 45 2014 4  2.086  -.58434
                 45 2015 4 2.0805  -.66139
                 53 2013 4      .        .
                 53 2014 4 2.0291  -.13596
                 53 2015 4 1.9806  -.12736
                 53 2016 4 1.8509  -.13341
                 78 2013 4      .        .
                 78 2014 4 2.1538  -.13596
                 78 2015 4    2.4  -.12736
                 78 2016 4 2.3929  -.13341
                 80 2013 1      .        .
                 80 2014 1 1.2785  -.13596
                 93 2013 4      .        .
                 93 2014 4 2.0291  -.13596
                 93 2015 4 1.9806  -.12736
                 93 2016 4 1.8509  -.13341
                 96 2013 5      .        .
                 96 2014 5 2.2212   -.9864
                 96 2015 5 2.1905 -1.01184
                 96 2016 5 2.1782  -.91109
                 98 2013 4      .        .
                 98 2014 4 2.0122  -.13596
                 98 2015 4 1.9024  -.12736
                 98 2016 4 1.8519  -.13341
                102 2013 4      .        .
                102 2014 4 1.8889  -.13596
                102 2015 4 1.8222  -.12736
                102 2016 4 1.6471  -.13341
                105 2013 5      .        .
                105 2014 4 2.0194  -.13596
                105 2015 4 1.9806  -.12736
                105 2016 4 1.8509  -.13341
                107 2013 4      .        .
                107 2014 4 2.1308   -.9864
                107 2015 4 2.1471 -1.01184
                107 2016 4  2.049  -.91109
                119 2013 3      .        .
                119 2014 3      2   -.3133
                119 2015 3 1.9706  -.30741
                119 2016 3      2  -.25386
                130 2013 4      .        .
                130 2014 4 2.2333  -.13596
                130 2015 4    2.2  -.12736
                130 2016 4 2.0909  -.13341
                131 2013 4      .        .
                131 2014 4 2.6019  -.74785
                131 2015 4 2.5825  -.67952
                131 2016 4 2.6311  -.65397
                132 2013 4      .        .
                132 2014 4 1.9848  -.13596
                132 2015 4 1.9559  -.12736
                132 2016 4 1.9851  -.13341
                end
                ------------------ copy up to and including the previous line ------------------

                Listed 100 out of 6705 observations
                Use the count() option to list more

                Thanks so much for your help,
                Laura

                Comment


                • #9
                  Laura:
                  IMHO, the issues with your -xtoprobit- are the following one:
                  1) regerssand: the number of observation belonging to -4- outperforms the other ones;
                  2) predictor -f2_env_1: the most frequent values are -.13596; -.13341;-.12736.

                  These issues cause convergence nuisances even reducing the regressand to level 4 and 5 only.
                  That said (and in the light of the Stata slip reported below) I would go pooled -oprobit- with clusteres standard error:
                  Code:
                  . xtset company_id year
                  
                  Panel variable: company_id (unbalanced)
                   Time variable: year, 2013 to 2016
                           Delta: 1 unit
                  
                  . xtoprobit dependiente260nueva sector_ans260_1 f2_env_1 i.year
                  
                  Fitting comparison model:
                  
                  Iteration 0:   log likelihood = -38.285906 
                  Iteration 1:   log likelihood = -29.623046 
                  Iteration 2:   log likelihood = -28.768322 
                  Iteration 3:   log likelihood =  -28.75611 
                  Iteration 4:   log likelihood = -28.756109 
                  
                  Refining starting values:
                  
                  Grid node 0:   log likelihood = -24.219394
                  
                  Fitting full model:
                  
                  Iteration 0:   log likelihood = -24.219394 
                  Iteration 1:   log likelihood = -14.727796 
                  cannot compute an improvement -- discontinuous region encountered
                  r(430);
                  
                  
                  . tab dependiente260nueva
                  
                  dependiente |
                     260nueva |      Freq.     Percent        Cum.
                  ------------+-----------------------------------
                            1 |          2        2.00        2.00
                            2 |          1        1.00        3.00
                            3 |          5        5.00        8.00
                            4 |         83       83.00       91.00
                            5 |          9        9.00      100.00
                  ------------+-----------------------------------
                        Total |        100      100.00
                  
                  . xtoprobit dependiente260nueva sector_ans260_1 f2_env_1 i.year if dependiente260nueva>=3
                  
                  Fitting comparison model:
                  
                  Iteration 0:   log likelihood = -32.988628 
                  Iteration 1:   log likelihood = -27.502153 
                  Iteration 2:   log likelihood = -27.015622 
                  Iteration 3:   log likelihood = -27.011553 
                  Iteration 4:   log likelihood = -27.011551 
                  
                  Refining starting values:
                  
                  Grid node 0:   log likelihood = -21.958659
                  
                  Fitting full model:
                  
                  Iteration 0:   log likelihood = -21.958659 
                  Iteration 1:   log likelihood =  -13.24823 
                  cannot compute an improvement -- discontinuous region encountered
                  r(430);
                  
                  
                  . xtoprobit dependiente260nueva sector_ans260_1 f2_env_1 i.year if dependiente260nueva>=4
                  
                  Fitting comparison model:
                  
                  Iteration 0:   log likelihood = -20.475593 
                  Iteration 1:   log likelihood = -13.674416 
                  Iteration 2:   log likelihood = -12.288659 
                  Iteration 3:   log likelihood =  -12.25383 
                  Iteration 4:   log likelihood = -12.253821 
                  Iteration 5:   log likelihood = -12.253821 
                  
                  Refining starting values:
                  
                  Grid node 0:   log likelihood = -9.1031647
                  
                  Fitting full model:
                  
                  Iteration 0:   log likelihood = -9.1031647 
                  Iteration 1:   log likelihood = -6.1792547 
                  Iteration 2:   log likelihood = -5.2856598  (not concave)
                  Iteration 3:   log likelihood = -5.0964147  (not concave)
                  Iteration 4:   log likelihood = -5.0751825  (not concave)
                  Iteration 5:   log likelihood =  -5.057029  (not concave)
                  Iteration 6:   log likelihood = -5.0542374  (not concave)
                  Iteration 7:   log likelihood = -732.52624  (not concave)
                  Iteration 8:   log likelihood = -5.1679583  (not concave)
                  Iteration 9:   log likelihood =   -5.05212  (not concave)
                  Iteration 10:  log likelihood = -5.0469519  (not concave)
                  Iteration 11:  log likelihood = -5.0435058  (not concave)
                  Iteration 12:  log likelihood = -5.0413634  (not concave)
                  Iteration 13:  log likelihood = -5.0407204  (not concave)
                  Iteration 14:  log likelihood =   -5.04034  (not concave)
                  Iteration 15:  log likelihood = -5.0401172  (not concave)
                  Iteration 16:  log likelihood = -5.0399874  (not concave)
                  Iteration 17:  log likelihood = -5.0399496  (not concave)
                  Iteration 18:  log likelihood = -5.0399277  (not concave)
                  Iteration 19:  log likelihood =  -5.039915  (not concave)
                  Iteration 20:  log likelihood = -5.0399112  (not concave)
                  Iteration 21:  log likelihood = -5.0399103  (not concave)
                  Iteration 22:  log likelihood = -5.0399096  (not concave)
                  Iteration 23:  log likelihood = -5.0399094  (not concave)
                  Iteration 24:  log likelihood = -5.0399093  (not concave)
                  <snip>
                  Iteration 300: log likelihood = -5.0399093  (not concave)
                  convergence not achieved
                  
                  Random-effects ordered probit regression                Number of obs    =  70
                  Group variable: company_id                              Number of groups =  24
                  
                  Random effects u_i ~ Gaussian                           Obs per group:
                                                                                       min =   2
                                                                                       avg = 2.9
                                                                                       max =   3
                  
                  Integration method: mvaghermite                         Integration pts. =  12
                  
                                                                          Wald chi2(2)     =   .
                  Log likelihood = -5.0399093                             Prob > chi2      =   .
                  
                  -------------------------------------------------------------------------------------
                  dependiente260nueva | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                  --------------------+----------------------------------------------------------------
                      sector_ans260_1 |   22.27126          .        .       .            .           .
                             f2_env_1 |  -10.90114          .        .       .            .           .
                                      |
                                 year |
                                2015  |   .2613234   2.550509     0.10   0.918    -4.737582    5.260229
                                2016  |   .6254498   3.708819     0.17   0.866    -6.643702    7.894601
                  --------------------+----------------------------------------------------------------
                                /cut1 |   64.85193          .                             .           .
                  --------------------+----------------------------------------------------------------
                            /sigma2_u |   45.83049          .                             .           .
                  -------------------------------------------------------------------------------------
                  
                  . tab f2_env_1
                  
                     f2_env_1 |      Freq.     Percent        Cum.
                  ------------+-----------------------------------
                     -1.01184 |          2        2.70        2.70
                       -.9864 |          2        2.70        5.41
                      -.95268 |          2        2.70        8.11
                      -.91109 |          2        2.70       10.81
                      -.76785 |          2        2.70       13.51
                      -.74878 |          2        2.70       16.22
                      -.74785 |          2        2.70       18.92
                      -.67952 |          2        2.70       21.62
                      -.66139 |          2        2.70       24.32
                      -.65397 |          2        2.70       27.03
                        -.621 |          1        1.35       28.38
                      -.58434 |          2        2.70       31.08
                      -.33368 |          2        2.70       33.78
                       -.3133 |          2        2.70       36.49
                      -.30741 |          2        2.70       39.19
                      -.29843 |          2        2.70       41.89
                      -.29758 |          2        2.70       44.59
                      -.25386 |          2        2.70       47.30
                      -.13596 |         14       18.92       66.22
                      -.13341 |         12       16.22       82.43
                      -.12736 |         13       17.57      100.00
                  ------------+-----------------------------------
                        Total |         74      100.00
                  
                  
                  . oprobit dependiente260nueva sector_ans260_1 f2_env_1 i.year, vce(cluster company_id)
                  
                  Iteration 0:   log pseudolikelihood = -38.285906 
                  Iteration 1:   log pseudolikelihood = -29.623046 
                  Iteration 2:   log pseudolikelihood = -28.768322 
                  Iteration 3:   log pseudolikelihood =  -28.75611 
                  Iteration 4:   log pseudolikelihood = -28.756109 
                  
                  Ordered probit regression                               Number of obs =     74
                                                                          Wald chi2(4)  =   8.89
                                                                          Prob > chi2   = 0.0639
                  Log pseudolikelihood = -28.756109                       Pseudo R2     = 0.2489
                  
                                                     (Std. err. adjusted for 26 clusters in company_id)
                  -------------------------------------------------------------------------------------
                                      |               Robust
                  dependiente260nueva | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                  --------------------+----------------------------------------------------------------
                      sector_ans260_1 |   2.617832   1.144352     2.29   0.022     .3749443     4.86072
                             f2_env_1 |  -1.302963   1.061604    -1.23   0.220    -3.383669    .7777425
                                      |
                                 year |
                                2015  |   .1755779   .1105152     1.59   0.112    -.0410279    .3921837
                                2016  |    .250019   .1238135     2.02   0.043     .0073491     .492689
                  --------------------+----------------------------------------------------------------
                                /cut1 |   3.069412     2.1843                     -1.211737    7.350561
                                /cut2 |   3.921286   2.046657                      -.090088     7.93266
                                /cut3 |    7.90058   2.466431                      3.066464     12.7347
                  -------------------------------------------------------------------------------------
                  
                  .
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    Thanks your sooner answer and your opinion. Thus, if I have understand correctly, it is preferable to estimate a pool ordered probit model with cluster option at firm level. Is this correct?

                    Considering the problem in our data, I suppose that the above option is better than estimate, for example, a GMM (panel data model controlling by endogeneity) due to the dependant variable values rank from 1 to 5 (exceptional, good, moderate, weak, inadequate)?

                    Best regards,
                    Laura

                    Comment


                    • #11
                      Laura:
                      I would go pooled -oprobit- with cluster option at firm level.
                      I do not think that your data support anything better.
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment

                      Working...
                      X