Announcement

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

  • Increasing space for column and row labels when tabulating results

    Hello everyone,

    I am doing five fixed effects regressions with five different dependent variables. To summarize my results, I want to generate a table that includes all 5 coefficients plus p-values and stars for significance. Currently, I am using this code:

    Code:
    eststo aa: qui xtreg patmfpc crisis i.agebrack sex brncntr ethminor i.edulvla ecoinsec lbrforce i.hinctnta   religious i.safe i.strgov i.trad i.rule lrscale  foreign, fe vce(robust)
    eststo ab: qui xtreg patmfse crisis i.agebrack sex brncntr ethminor i.edulvla ecoinsec lbrforce i.hinctnta   religious i.safe i.strgov i.trad i.rule lrscale  foreign, fe vce(robust)
    eststo ac: qui xtreg patmfde crisis i.agebrack sex brncntr ethminor i.edulvla ecoinsec lbrforce i.hinctnta   religious i.safe i.strgov i.trad i.rule lrscale  foreign, fe vce(robust)
    eststo ad: qui xtreg imp_eco crisis i.agebrack sex brncntr ethminor i.edulvla ecoinsec lbrforce i.hinctnta   religious i.safe i.strgov i.trad i.rule lrscale  foreign, fe vce(robust)
    eststo ae: qui xtreg imp_cult crisis i.agebrack sex brncntr ethminor i.edulvla ecoinsec lbrforce i.hinctnta   religious i.safe i.strgov i.trad i.rule lrscale  foreign, fe vce(robust)
    
    esttab aa ab ac ad ae, star(* 0.1 ** 0.05 *** 0.01)  p scalars(r2) compress label title(The effect of the share of foreigner on immigration opinion) nonumbers mtitles("More/less from poor countries" "More/less from same ethnic grp" "More/ less from diff. ethnic grp" "Immigr. improve economy" "Immigr. improve culture")
    This is how the column label line looks:
    Click image for larger version

Name:	Unbenannt.PNG
Views:	1
Size:	17.1 KB
ID:	1524645



    My issue is, that the labels for the different columns do not fit into the form that Stata automatically gives to my table. Is there any way to make the column-label row wider, so that all my labels fit in? Or would I need to replicate the table in LaTex, in order to make it more readable?

    Thank you very much in advance for your help!
    Aileen

  • #2
    esttab is from SSC/ Stata Journal. The option -modelwidth()- allows you to specify the width of the results column. Additionally, -noabbrev- will unabbreviate your titles. But ultimately, if the table is too long, you may need to create it with landscape as opposed to portrait orientation. In your case, I think that multiple lines will be better rather than trying to fit the whole title. This can be done in a LaTeX table, see Nils Enevoldsen's method here.

    Code:
    webuse grunfeld, clear
    eststo: qui xtreg invest mvalue, fe
    eststo: qui xtreg invest mvalue kstock, fe
    eststo: qui xtreg invest mvalue kstock time, fe
    esttab, mtitle("A very very long title" "A very very long title" "A very very long title")
    esttab, mtitle("A very very long title" "A very very long title" "A very very long title") noabbrev
    esttab, mtitle("A very very long title" "A very very long title" "A very very long title") noabbrev modelwidth(20)

    Res.:

    Code:
    . esttab, mtitle("A very very long title" "A very very long title" "A very very long title")
    
    ------------------------------------------------------------
                          (1)             (2)             (3)   
                 A very ver~e    A very ver~e    A very ver~e   
    ------------------------------------------------------------
    mvalue              0.190***        0.110***        0.111***
                      (10.55)          (9.29)          (9.56)   
    
    kstock                              0.310***        0.354***
                                      (17.87)         (16.18)   
    
    time                                               -2.664** 
                                                      (-3.16)   
    
    _cons              -59.43**        -58.74***       -43.43** 
                      (-2.91)         (-4.72)         (-3.32)   
    ------------------------------------------------------------
    N                     200             200             200   
    ------------------------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    
    . 
    . esttab, mtitle("A very very long title" "A very very long title" "A very very long title") noabbrev
    
    ------------------------------------------------------------
                          (1)             (2)             (3)   
                 A very very long title    A very very long title    A very very long title   
    ------------------------------------------------------------
    mvalue              0.190***        0.110***        0.111***
                      (10.55)          (9.29)          (9.56)   
    
    kstock                              0.310***        0.354***
                                      (17.87)         (16.18)   
    
    time                                               -2.664** 
                                                      (-3.16)   
    
    _cons              -59.43**        -58.74***       -43.43** 
                      (-2.91)         (-4.72)         (-3.32)   
    ------------------------------------------------------------
    N                     200             200             200   
    ------------------------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    
    . 
    . esttab, mtitle("A very very long title" "A very very long title" "A very very long title") noabbrev modelwidth(20)
    
    ------------------------------------------------------------------------------------
                                  (1)                     (2)                     (3)   
                 A very very long title    A very very long title    A very very long title   
    ------------------------------------------------------------------------------------
    mvalue                      0.190***                0.110***                0.111***
                              (10.55)                  (9.29)                  (9.56)   
    
    kstock                                              0.310***                0.354***
                                                      (17.87)                 (16.18)   
    
    time                                                                       -2.664** 
                                                                              (-3.16)   
    
    _cons                      -59.43**                -58.74***               -43.43** 
                              (-2.91)                 (-4.72)                 (-3.32)   
    ------------------------------------------------------------------------------------
    N                             200                     200                     200   
    ------------------------------------------------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    Comment


    • #3
      Thanks a lot Andrew! I will try it out and opt to LaTex if its too large.

      Comment

      Working...
      X