Announcement

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

  • etable for mlogit estimates - how to get rrr?

    Hi all,

    I am working with mlogit, and I do realises that the rrr option just affect how the results are displayed.
    However, can I get the rrr and CI instead of coeff and se in etable?

    Here is the example code I was running, I couldn't figure out if the eform is available in etable:
    etable, estimates (model1 model 2) cstat(_r_b) cstat(_r_ci) cstat(_r_p) stars(0.0125 "*" 0.0025 "**") showstars showstarsnote ///
    mstat(N) mstat(r2) mstat(aic) mstat(bic) export(results.docx, replace)

  • #2
    -eform- does not have an -eform- option. But your -mlogit- command does, called -rrr-. So use the -rrr- option on -mlogit- and then run -etable-, and the latter will then table the relative risk ratios instead of the coefficients.

    Comment


    • #3
      Hi Clyde,

      Thank you so much for your answer. However, I still have this issue. Note that I am using a Stata kernel and it is ran from Jupyter notebook and that cannot be changed.
      When I try to replicate this problem with test data, I get the RRR in etable, which is very frustrating.

      When I run:
      Code:
      mlogit trait1 i.trait2 i.trait3, rrr
      estimates store model1
      This is the head of the output (the names of the actual variables are changed):
      Click image for larger version

Name:	Screenshot 2025-09-10 110056.png
Views:	1
Size:	113.9 KB
ID:	1781719






      However, when I run the etable, it is still shown as coeff instead of RRR:
      Code:
      etable, estimates (model1) cstat(_r_b) cstat(_r_ci) cstat(_r_p) /// stars(0.0125 "*" 0.0025 "**") showstars showstarsnote mstat(N) mstat(r2) mstat(aic) mstat(bic) /// export(results.docx, replace)
      Click image for larger version

Name:	Screenshot 2025-09-10 110339.png
Views:	1
Size:	36.6 KB
ID:	1781720

      Last edited by Nina Fajs; 10 Sep 2025, 04:06.

      Comment


      • #4
        I cannot replicate your problem in my setup. Here I run -mlogit, rrr- followed by -etable-, and -etable- properly displays the odds ratios and their confidence intervals.

        Code:
        . sysuse auto, clear
        (1978 automobile data)
        
        . 
        . mlogit rep78 i.foreign mpg price, rrr
        
        Iteration 0:  Log likelihood = -93.692061  
        Iteration 1:  Log likelihood = -77.396517  
        Iteration 2:  Log likelihood = -75.281559  
        Iteration 3:  Log likelihood = -74.998968  
        Iteration 4:  Log likelihood = -74.951486  
        Iteration 5:  Log likelihood = -74.939579  
        Iteration 6:  Log likelihood = -74.937162  
        Iteration 7:  Log likelihood = -74.936639  
        Iteration 8:  Log likelihood = -74.936522  
        Iteration 9:  Log likelihood = -74.936492  
        Iteration 10: Log likelihood = -74.936486  
        
        Multinomial logistic regression                         Number of obs =     69
                                                                LR chi2(12)   =  37.51
                                                                Prob > chi2   = 0.0002
        Log likelihood = -74.936486                             Pseudo R2     = 0.2002
        
        ------------------------------------------------------------------------------
               rep78 |        RRR   Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
        1            |
             foreign |
            Foreign  |   1.17e-06   .0025892    -0.01   0.995            0           .
                 mpg |   1.000732   .1926954     0.00   0.997     .6861436    1.459555
               price |   .9995268   .0007917    -0.60   0.550     .9979764     1.00108
               _cons |   .8311469   5.465247    -0.03   0.978     2.10e-06    328696.4
        -------------+----------------------------------------------------------------
        2            |
             foreign |
            Foreign  |   1.00e-06    .001113    -0.01   0.990            0           .
                 mpg |   .9777956   .1078435    -0.20   0.839     .7877111     1.21375
               price |    .999935   .0001621    -0.40   0.688     .9996173    1.000253
               _cons |   .6803167   1.899598    -0.14   0.890     .0028574    161.9789
        -------------+----------------------------------------------------------------
        3            |  (base outcome)
        -------------+----------------------------------------------------------------
        4            |
             foreign |
            Foreign  |   8.106832   6.672772     2.54   0.011     1.615188     40.6892
                 mpg |   1.032125   .0852689     0.38   0.702     .8778303    1.213541
               price |    .999975   .0001346    -0.19   0.853     .9997112    1.000239
               _cons |   .2098572    .462293    -0.71   0.478     .0027978    15.74092
        -------------+----------------------------------------------------------------
        5            |
             foreign |
            Foreign  |   19.14689   20.01832     2.82   0.005     2.466926    148.6074
                 mpg |   1.246044    .128245     2.14   0.033     1.018419    1.524546
               price |   1.000173   .0001826     0.95   0.344     .9998148    1.000531
               _cons |   .0002251   .0007341    -2.58   0.010     3.77e-07    .1343249
        ------------------------------------------------------------------------------
        Note: _cons estimates baseline relative risk for each outcome.
        
        . estimates store model1
        
        . 
        . etable, estimates (model1) cstat(_r_b) cstat(_r_ci) cstat(_r_p)  /// 
        > stars(0.0125 "*" 0.0025 "**") showstars showstarsnote mstat(N) mstat(r2) mstat(aic) mstat(bic) 
        
        ------------------------------------------
                                      rep78       
        ------------------------------------------
        Car origin                                
          Foreign                          0.000  
                                         [0.000]  
                                            1.00  
        Mileage (mpg)                      1.001  
                               [0.686     1.460]  
                                            1.00  
        Price                              1.000  
                               [0.998     1.001]  
                                            0.55  
        Intercept                          0.831  
                               [0.000  3.29e+05]  
                                            0.98  
        Car origin                                
          Foreign                          0.000  
                                         [0.000]  
                                            0.99  
        Mileage (mpg)                      0.978  
                               [0.788     1.214]  
                                            0.84  
        Price                              1.000  
                               [1.000     1.000]  
                                            0.69  
        Intercept                          0.680  
                               [0.003   161.979]  
                                            0.89  
        Car origin                                
          Foreign                          8.107 *
                               [1.615    40.689]  
                                            0.01  
        Mileage (mpg)                      1.032  
                               [0.878     1.214]  
                                            0.70  
        Price                              1.000  
                               [1.000     1.000]  
                                            0.85  
        Intercept                          0.210  
                               [0.003    15.741]  
                                            0.48  
        Car origin                                
          Foreign                         19.147 *
                               [2.467   148.607]  
                                            0.00  
        Mileage (mpg)                      1.246  
                               [1.018     1.525]  
                                            0.03  
        Price                              1.000  
                               [1.000     1.001]  
                                            0.34  
        Intercept                          0.000 *
                               [0.000     0.134]  
                                            0.01  
        Number of observations                69  
        AIC                               181.87  
        BIC                               217.62  
        ------------------------------------------
        ** p<.0025, * p<.0125
        It may be that this problem arises from your setup. I suggest you contact Stata Tech Support about this. Be sure to provide them with the details (version numbers) of your Stata installation, Jupyter, and operating system, as well as your exact code and a data example reproducing the problem.

        Comment

        Working...
        X