Announcement

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

  • error statement r(1400) "initial values not feasible" when running melogit

    Hi. I'm using Stata 18.0/SE and am running into an error r(1400). I am trying to run the null model using multilevel logistic regression. The model is using 612,215 observations and 34 hospitals. The outcome variable is a birth mode (CD), dichotomized as 'Yes' for cesarean and 'No' for natural delivery. All mothers are nested in 34 hospitals.
    Code:
    melogit CD || hosid:

    I also tried meqrlogit command, it runs smoothly in the null model but not in the full model.

    Any recommendations to fix r(1400) in melogit? Thank you.
    Attached Files

  • #2
    You can specify your own initial values if you look at the documentation, but I doubt that this will help much because Stata's algorithm is efficient in attempting to find initial values. If one estimator executes successfully, you can use its estimates as starting values for the other estimator. However, there is no guarantee that maximum likelihood (ML) estimation will converge. You might try the community-contributed command gllamm from SSC to see if you have better luck using adaptive quadrature.


    Code:
    webuse bangladesh, clear
    melogit c_use || district:
    gllamm c_use, i(district) family(binomial) link(logit) adapt
    Res.:

    Code:
    . melogit c_use || district:
    
    Fitting fixed-effects model:
    
    Iteration 0:  Log likelihood = -1297.1523  
    Iteration 1:  Log likelihood = -1295.4549  
    Iteration 2:  Log likelihood = -1295.4547  
    Iteration 3:  Log likelihood = -1295.4547  
    
    Refining starting values:
    
    Grid node 0:  Log likelihood = -1277.4145
    
    Fitting full model:
    
    Iteration 0:  Log likelihood = -1277.4145  (not concave)
    Iteration 1:  Log likelihood = -1270.5822  
    Iteration 2:  Log likelihood =  -1267.173  
    Iteration 3:  Log likelihood = -1267.0504  
    Iteration 4:  Log likelihood =   -1267.05  
    Iteration 5:  Log likelihood =   -1267.05  
    
    Mixed-effects logistic regression               Number of obs     =      1,934
    Group variable: district                        Number of groups  =         60
    
                                                    Obs per group:
                                                                  min =          2
                                                                  avg =       32.2
                                                                  max =        118
    
    Integration method: mvaghermite                 Integration pts.  =          7
    
                                                    Wald chi2(0)      =          .
    Log likelihood = -1267.05                       Prob > chi2       =          .
    ------------------------------------------------------------------------------
           c_use | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           _cons |  -.5382852   .0858361    -6.27   0.000    -.7065208   -.3700496
    -------------+----------------------------------------------------------------
    district     |
       var(_cons)|   .2495268   .0798179                      .1333023    .4670862
    ------------------------------------------------------------------------------
    LR test vs. logistic model: chibar2(01) = 56.81       Prob >= chibar2 = 0.0000
    
    . 
    . gllamm c_use, i(district) family(binomial) link(logit) adapt
    
    Running adaptive quadrature
    Iteration 0:    log likelihood = -1267.7654
    Iteration 1:    log likelihood = -1267.0517
    Iteration 2:    log likelihood = -1267.0505
    
    
    Adaptive quadrature has converged, running Newton-Raphson
    Iteration 0:  Log likelihood = -1267.0505  
    Iteration 1:  Log likelihood = -1267.0505  
    Iteration 2:  Log likelihood = -1267.0499  
    Iteration 3:  Log likelihood = -1267.0499  
     
    number of level 1 units = 1934
    number of level 2 units = 60
     
    Condition Number = 1.1930625
     
    gllamm model 
     
    log likelihood = -1267.0499
     
    ------------------------------------------------------------------------------
           c_use | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           _cons |  -.5382849   .0858361    -6.27   0.000    -.7065206   -.3700492
    ------------------------------------------------------------------------------
     
     
    Variances and covariances of random effects
    ------------------------------------------------------------------------------
    
     
    ***level 2 (district)
     
        var(1): .24952672 (.07981958)
    ------------------------------------------------------------------------------

    Comment


    • #3
      Originally posted by Umba Shine View Post
      I also tried meqrlogit command, it runs smoothly in the null model . . .

      Any recommendations to fix r(1400) in melogit?
      Along the lines of Andrew's suggestion, you could try something like the following.
      Code:
      meqrlogit CD || hosid:
      matrix define B = e(b)
      
      melogit foreign || rep78:, noestimate
      local colnames : colfullnames e(b)
      matrix colnames B = `colnames'
      
      melogit CD || hosid: , from(B) // -copy- doesn't seem to work anymore
      It seems strange that you would get that kind of error with the empty regression model. Would you be able to do something like
      Code:
      contract hosid CD, freq(count)
      and post the result via -dataex- here on the List so that others might be able to see what's going on, and possibly come up with a further suggestion?

      (My initial suspicion was that the result won't have 2 × 34 rows, and if that turns out to be the case, then you might need to resort to a penalized maximum likelihood estimator or a Bayesian regression model with regularizing priors.)

      Comment

      Working...
      X