Announcement

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

  • Formatting Marginal Effects Output with Esttab or Estout

    I am running a panel logit regression using and outputting the results with esttab. (Though any help you can give for regular logit/probit is also appreciated.)

    In the below case, turnover is a categorical variable which takes on three values, 1 for "None", 2 for "Half", and 3 for "Full".

    Code:
       xtologit turnover independence,vce(cluster country)
      eststo panel_log: margins,dydx(independence) post
        esttab panel_log using "${Tables}/panel_log.tex",title(Mean Marginal Effects, Ordered Logit Panel Regression, Random Effects, Clustered Standard Errors \label{panel_log}) label replace compress booktabs wrap varwidth(40) mtitles("Turnover")
    However, when I look at the compiled LaTex output, the leftmost table column contains the variable label (as desired) but then also the following representing variable levels.

    Click image for larger version

Name:	col.jpg
Views:	1
Size:	6.5 KB
ID:	1603151

    I'm trying to change how the levels are displayed, so instead of 1._predict I would have "None". I tried setting the value labels for turnover, but that didn't seem to do anything. Can anyone help?

    Thanks.

  • #2
    esttab is from the Stata Journal/ SSC (FAQ Advice #12). You can specify labels for the coefficients using the -coeflabel()- option.

    Code:
    webuse tvsfpors
    xtset school
    xtologit thk prethk cc##tv
    eststo panel_log: margins,dydx(prethk) post
    esttab, coeflabels(1._predict "Whatever 1" 2._predict "Whatever 2")
    Res.:

    Code:
    . esttab, coeflabels(1._predict "Whatever 1" 2._predict "Whatever 2")
    
    ----------------------------
                          (1)  
                                
    ----------------------------
    prethk                      
    Whatever 1        -0.0645***
                      (-9.92)  
    
    Whatever 2        -0.0266***
                      (-8.23)  
    
    3._predict         0.0165***
                       (5.68)  
    
    4._predict         0.0746***
                      (10.66)  
    ----------------------------
    N                    1600  
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    
    .

    Comment


    • #3
      Wow, that is amazing and very easy (I was afraid I would have to use estout and customize a bunch of settings). Thanks so much.

      Comment

      Working...
      X