Announcement

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

  • Mlogit - output to Excel horizontally

    Hello,

    I am running a number of mlogit models with several variations of the dependent and one of the independent variables. I would like to export the output to Excel with the models being reported next to each other like simple outreg would for OLS.

    Currently, I am using the following but the models are stacked and very hard to compare:

    foreach i in aa bb cc {
    foreach j in dd ee ff {

    mlogit residrank_`j' `i' at_log , base(1)

    est store model

    estout model using mlogit.csv, stats(r2_p chi2 N, labels("Pseudo R-squared" "Model chi-square" "N")) cells(b(star fmt(%9.2f)) t(par)) varwidth(30) modelwidth(10) label unstack append

    }
    }

    Would be grateful for any suggestions.
    Thanks in advance!

  • #2
    Store each output as separate model and move the Ben Jann's -estout- outside of the loops (ssc desc estout). For example:

    Code:
    . webuse sysdsn1, clear
    (Health insurance data)
    
    . forv i = 1/2 {
      2.         qui mlogit insure age male nonwhite i.site, base(1)
      3.         est store model`i'
      4. }
    
    . estout model* , unstack  cells(b(star fmt(%9.2f)) t(par)) varwidth(30) modelwidth(10) label 
    
    ------------------------------------------------------------------------------------------------------------------
                                       model1                                    model2                               
                                    Indemnity       Prepaid      Uninsure     Indemnity       Prepaid      Uninsure   
                                          b/t           b/t           b/t           b/t           b/t           b/t   
    ------------------------------------------------------------------------------------------------------------------
    NEMC (ISCNRD-IBIRTHD)/365.25         0.00         -0.01         -0.01          0.00         -0.01         -0.01   
                                          (.)       (-1.90)       (-0.68)           (.)       (-1.90)       (-0.68)   
    NEMC PATIENT MALE                    0.00          0.56**        0.45          0.00          0.56**        0.45   
                                          (.)        (2.77)        (1.23)           (.)        (2.77)        (1.23)   
    nonwhite                             0.00          0.97***       0.22          0.00          0.97***       0.22   
                                          (.)        (4.12)        (0.51)           (.)        (4.12)        (0.51)   
    site=1                               0.00          0.00          0.00          0.00          0.00          0.00   
                                          (.)           (.)           (.)           (.)           (.)           (.)   
    site=2                               0.00          0.11         -1.21*         0.00          0.11         -1.21*  
                                          (.)        (0.54)       (-2.57)           (.)        (0.54)       (-2.57)   
    site=3                               0.00         -0.59**       -0.21          0.00         -0.59**       -0.21   
                                          (.)       (-2.58)       (-0.57)           (.)       (-2.58)       (-0.57)   
    _cons                                0.00          0.27         -1.29*         0.00          0.27         -1.29*  
                                          (.)        (0.82)       (-2.17)           (.)        (0.82)       (-2.17)   
    ------------------------------------------------------------------------------------------------------------------

    Comment

    Working...
    X