Announcement

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

  • Ordered Logit model: discontinuous region with missing values encountered when estimating ME

    Dear Statalist,

    I am using Stata 15.1 and want to estimate the marginal effects of an ordered logit model that has an outcome variable with three categories.
    When running the model
    Code:
    xtologit insurance_type rain_previous WTP_group P_InsuranceC Female age2 Educ2 ///
    i.InsuranceExp##i.InsuranceUnderstanding Trust_Company HHsize2 DepRate Crowding RCSI ///
    FamilyRemittances DurationFarmer RainFed log_Yield AverProdSold AverDangerProdLoss ///
    RiskAversion, vce(robust) nolog
    it shows the following output:
    HTML Code:
    Random-effects ordered logistic regression      Number of obs     =        218
    Group variable: HHid                            Number of groups  =         56
    
    Random effects u_i ~ Gaussian                   Obs per group:
                                                                  min =          1
                                                                  avg =        3.9
                                                                  max =          5
    
    Integration method: mvaghermite                 Integration pts.  =         12
    
                                                    Wald chi2(23)     =      50.98
    Log pseudolikelihood  = -185.80101              Prob > chi2       =     0.0007
    
                                                             (Std. Err. adjusted for 56 clusters in HHid)
    -----------------------------------------------------------------------------------------------------
                                        |               Robust
                         insurance_type |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------------------------+----------------------------------------------------------------
                          rain_previous |  -.0622835   .1704658    -0.37   0.715    -.3963903    .2718234
                              WTP_group |   4.129787   2.252134     1.83   0.067    -.2843142    8.543888
                           P_InsuranceC |  -.1946897   .5041385    -0.39   0.699    -1.182783    .7934037
                                 Female |  -.6773839     .45346    -1.49   0.135    -1.566149    .2113813
                                   age2 |  -.0001368   .0002462    -0.56   0.579    -.0006194    .0003458
                                  Educ2 |  -.0168312   .0207194    -0.81   0.417    -.0574405    .0237782
                         1.InsuranceExp |   .6841136   1.052551     0.65   0.516    -1.378848    2.747075
                                        |
                 InsuranceUnderstanding |
                                     2  |  -.3914879    1.11747    -0.35   0.726    -2.581688    1.798713
                                     3  |   .7297591   .9662533     0.76   0.450    -1.164063    2.623581
                                        |
    InsuranceExp#InsuranceUnderstanding |
                                   1 2  |   .4299672   1.260509     0.34   0.733    -2.040586     2.90052
                                   1 3  |  -.1093954    1.09006    -0.10   0.920    -2.245873    2.027083
                                        |
                          Trust_Company |  -.0792627   .3887562    -0.20   0.838    -.8412109    .6826855
                                HHsize2 |   .0092903   .0036231     2.56   0.010     .0021892    .0163913
                                DepRate |   .0620267   .6466889     0.10   0.924     -1.20546    1.329514
                               Crowding |   .3460283   .3461374     1.00   0.317    -.3323885    1.024445
                                   RCSI |   .2281215   .1541255     1.48   0.139     -.073959     .530202
                      FamilyRemittances |  -.1089542   .3493816    -0.31   0.755    -.7937295    .5758211
                         DurationFarmer |  -.0098795   .0386288    -0.26   0.798    -.0855906    .0658316
                                RainFed |   .3382859   .5544276     0.61   0.542    -.7483723    1.424944
                              log_Yield |  -.2135142   .1554528    -1.37   0.170    -.5181961    .0911678
                           AverProdSold |   .0096645   .0057879     1.67   0.095    -.0016795    .0210086
                     AverDangerProdLoss |  -.1618212   .1662221    -0.97   0.330    -.4876106    .1639681
                           RiskAversion |   .5916548   .4358455     1.36   0.175    -.2625866    1.445896
    ------------------------------------+----------------------------------------------------------------
                                  /cut1 |   1.675089   2.847313                     -3.905542     7.25572
                                  /cut2 |   4.032432   2.901428                     -1.654263    9.719127
    ------------------------------------+----------------------------------------------------------------
                              /sigma2_u |   6.80e-32   1.25e-31                      1.83e-33    2.52e-30
    -----------------------------------------------------------------------------------------------------
    However, when I want to estimate the marginal effects with
    Code:
    margins, dydx(*) predict(outcome(3))
    It just gives me the error message "could not calculate numerical derivatives -- discontinuous region with missing values encountered
    r(459);"

    I can avoid this problem by dropping the binary trust variable but this is not what I want. Also when running the binary logit, it works perfectly with the specified variables. Can someone explain why the calculation does not run through? Is there a way to fix this or are the variables simply not made for this model?

    Thanks!!!

  • #2
    Well, I don't see any binary variable called trust in your model. You have a variable called Trust_Company, but you have specified it as continuous, not binary. If your intent is for this variable to be treated as a binary variable, you need to specify it as i.Trust_Company in your -xtologit- command. Indeed, had the calculations gone through, the answers you would have gotten would have been wrong: marginal effects are calculated differently for discrete and continuous variables. This also implies that marginal effects calculated after -logit- are wrong and need to be redone.

    Whether this will eliminate your problem I am not sure. If it is the derivative of the outcome with respect to Trust_Company that is blocking the calculation of that marginal effect, then going to i.Trust_Company will solve the problem, because the marginal effect of a binary variable does not involve calculating that derivative. But it is also possible that the problem with calculating numerical derivatives is actually due to things going on with other variables in the presence of Trust_Company--and in that case the problem may persist.

    Anyway, you need to use i.Trust_Company in order to get correct answers. It might also resolve the issue that is provoking your error message.

    Comment


    • #3
      Thanks Clyde!
      In fact specifying the binary independent variables as binary does change my results and also does not solve my problem, unfortunately.

      As I dont really understand the error message I also dont know how to solve the problem structurally. Can anyone help?

      Comment


      • #4
        Well, the likelihood function for -xtologit- is very complicated and often not well behaved. Sometimes you just cannot do things that you would want to do and that seem reasonable.

        Here is what I would do next in your situation. Start with the absolutely minimal model of your problem:

        Code:
        xtologit insurance_type i.InsuranceExp##i.InsuranceUnderstanding
        margins, dydx(*) predict(outcome(3))
        and see if that runs. (You will not get a marginal effect for the InsuranceExp#InsuranceUnderstanding term, because interaction terms do not have marginal effects--so don't worry about that.) If so, pick one covariate to add to the model--whichever you think is most important, then try that. Keep going, adding one more covariate each time until you fail. Then go back to the last successful model and try adding a different new covariate, and keep going. Eventually you will work your way up to the fullest model that you can do these calculations on. And you will have to settle for that.

        Another thing to consider is this. From your -margins- command, it appears that you are mostly, perhaps only, interested in outcome 3. If so, I would change the insurance variable to a dichotomy: current outcome 3 vs any other outcome, and go to -xtlogit-. The likelihood for -xtlogit- is sometimes troublesome, but it is far better behaved than that of -xtologit-. It may be that the inclusion of all three outcomes is just adding needless detail and jamming up the works.

        Comment


        • #5
          Also, I suppose it's worth asking if the issue only occurs when you try to predict outcome 3. If you can predict outcomes 1 and 2, then you could arrive at the point estimate for outcome 3 via algebra.
          Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

          When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

          Comment


          • #6
            Thanks for your comments!
            Whatever I do the ordered logit command would not give me marginal effects. However, if I split my 3-categorical-outcome variable into 3 binary logit models, then the the ME are calculated without any problems. Interesting!

            The fact that I do not take the order of the outcome variable into account this way, is not really a problem in my research context as the outcome contains different insurance contracts that can be put in an order according to price and payout. However, if this is being neglected, it should not create a semantical problem.
            Last edited by Kerstin Schmidt; 08 Mar 2019, 08:57.

            Comment


            • #7
              @Weiwen: yes, the problem occurred for whatever outcome I wanted to predict...

              Comment

              Working...
              X