Announcement

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

  • mlogit postestimation: "system limit exceeded - see manual r(1000)"

    Hi everyone

    I have an error message that I don't really know how to interpret.

    I want to estimate a multinomial logit model and afterwards I would like to estimate average marginal effects.

    This is basically how my data looks:

    Code:
    . tab y x
    
               |           x
             y |        No        Yes |     Total
    -----------+----------------------+----------
         Cat 1 |       675        269 |       944
         Cat 2 |       816        202 |     1,018
         Cat 3 |     1,827        282 |     2,109
    -----------+----------------------+----------
         Total |     3,318        753 |     4,071
    Not a huge data set, reasonable distributions of values, not too many categories, I would think.

    Running the model also causes no problems:

    Code:
    . mlogit y x
    
    Iteration 0:  Log likelihood = -4177.7065  
    Iteration 1:  Log likelihood = -4129.9641  
    Iteration 2:  Log likelihood =  -4129.282  
    Iteration 3:  Log likelihood = -4129.2818  
    
    Multinomial logistic regression                         Number of obs =  4,071
                                                            LR chi2(2)    =  96.85
                                                            Prob > chi2   = 0.0000
    Log likelihood = -4129.2818                             Pseudo R2     = 0.0116
    
    ------------------------------------------------------------------------------
               y | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    Cat_1        |
               x |   .9485219   .0963971     9.84   0.000     .7595871    1.137457
           _cons |  -.9957179   .0450425   -22.11   0.000       -1.084   -.9074362
    -------------+----------------------------------------------------------------
    Cat_2        |
               x |   .4723767   .1013382     4.66   0.000     .2737575    .6709959
           _cons |  -.8060162   .0421051   -19.14   0.000    -.8885406   -.7234918
    -------------+----------------------------------------------------------------
    Cat_3        |  (base outcome)
    ------------------------------------------------------------------------------
    Then I'd like to have AME's and so I run -margins- right after -mlogit-:

    Code:
    . margins, dydx(x) predict(outcome(2))
    system limit exceeded - see manual
    r(1000);
    How can that be?

    My Stata version is

    Code:
    . about
    
    StataNow/MP 18.5 for Windows (64-bit x86-64)
    Revision 26 Feb 2025
    Copyright 1985-2023 StataCorp LLC
    
    Total physical memory:       16.00 GB
    Available physical memory:    2.46 GB
    
    Stata license: Unlimited-user 4-core network, expiring 14 Dec 2025
    Thanks so much
    KS

  • #2
    For what it's worth I do not reproduce the error running v17.0 on my Mac.
    Code:
    . about
    
    Stata/SE 17.0 for Mac (Intel 64-bit)
    Revision 21 May 2024
    Copyright 1985-2021 StataCorp LLC
    
    Total physical memory: 8.01 GB
    
    Stata license: Unlimited-user network, expiring 23 Oct 2025
    Serial number: 401809302077
      Licensed to: John Mullahy
                   UW-Madison
    
    .
    . tab2 y x
    
    -> tabulation of y by x  
    
               |           x
             y |         0          1 |     Total
    -----------+----------------------+----------
             1 |       675        269 |       944
             2 |       816        202 |     1,018
             3 |     1,827        282 |     2,109
    -----------+----------------------+----------
         Total |     3,318        753 |     4,071
    
    .
    . mlogit y x
    
    Iteration 0:   log likelihood = -4177.7065  
    Iteration 1:   log likelihood = -4129.9641  
    Iteration 2:   log likelihood =  -4129.282  
    Iteration 3:   log likelihood = -4129.2818  
    
    Multinomial logistic regression                         Number of obs =  4,071
                                                            LR chi2(2)    =  96.85
                                                            Prob > chi2   = 0.0000
    Log likelihood = -4129.2818                             Pseudo R2     = 0.0116
    
    ------------------------------------------------------------------------------
               y | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    1            |
               x |   .9485219   .0963971     9.84   0.000     .7595871    1.137457
           _cons |  -.9957179   .0450425   -22.11   0.000       -1.084   -.9074362
    -------------+----------------------------------------------------------------
    2            |
               x |   .4723767   .1013382     4.66   0.000     .2737575    .6709959
           _cons |  -.8060162   .0421051   -19.14   0.000    -.8885406   -.7234918
    -------------+----------------------------------------------------------------
    3            |  (base outcome)
    ------------------------------------------------------------------------------
    
    .
    . margins, dydx(x)
    
    Average marginal effects                                 Number of obs = 4,071
    Model VCE: OIM
    
    dy/dx wrt: x
    
    1._predict: Pr(y==1), predict(pr outcome(1))
    2._predict: Pr(y==2), predict(pr outcome(2))
    3._predict: Pr(y==3), predict(pr outcome(3))
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    x            |
        _predict |
              1  |   .1379269   .0148045     9.32   0.000     .1089107    .1669431
              2  |   .0330583   .0170505     1.94   0.053    -.0003602    .0664767
              3  |  -.1709852   .0196763    -8.69   0.000      -.20955   -.1324204
    ------------------------------------------------------------------------------
    
    . margins, dydx(x) predict(outcome(2))
    
    Average marginal effects                                 Number of obs = 4,071
    Model VCE: OIM
    
    Expression: Pr(y==2), predict(outcome(2))
    dy/dx wrt:  x
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
               x |   .0330583   .0170505     1.94   0.053    -.0003602    .0664767
    ------------------------------------------------------------------------------

    Comment

    Working...
    X