Announcement

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

  • how to set the model titles in a more elegant way for esttab

    ***ssc install esttab
    I want the model titles to be "Model 1" "Model 2" "Model 3", I know we can set it using
    Code:
    esttab, mtitles("Model 1" "Model 2" "Model 3")
    however, I have a series of models, I want to use the number option and the prefix option to generate model titles automatically. However, it always includes the names stored in Stata. How to correct this?
    Code:
    esttab mlab(,numbers notitles  prefix("Model ")
    Click image for larger version

Name:	1.png
Views:	1
Size:	15.4 KB
ID:	1659031

  • #2
    If you are sequentially naming columns, then just prefix the numbers with "Model ".

    Code:
    sysuse auto, clear
    eststo m1: reg mpg weight
    eststo m2: reg mpg weight disp
    eststo m3: reg mpg weight disp turn
    esttab m*, numbers("Model ") mlab(none) lab
    Res.:

    Code:
    . esttab m*, numbers("Model ") mlab(none) lab
    
    --------------------------------------------------------------------
                              Model 1         Model 2         Model 3  
    --------------------------------------------------------------------
    Weight (lbs.)            -0.00601***     -0.00657***     -0.00593***
                             (-11.60)         (-5.63)         (-4.14)  
    
    Displacement .. in.)                      0.00528         0.00560  
                                               (0.54)          (0.56)  
    
    Turn Circle (ft.)                                          -0.139  
                                                              (-0.77)  
    
    Constant                    39.44***        40.08***        43.59***
                              (24.44)         (19.84)          (8.78)  
    --------------------------------------------------------------------
    Observations                   74              74              74  
    --------------------------------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    Last edited by Andrew Musau; 11 Apr 2022, 17:17.

    Comment


    • #3
      Oh my god, I'm surprised I didn't find that option. Thanks so much!

      Comment

      Working...
      X