Announcement

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

  • Display st.error under mean in esttab

    Hi!
    This is my code and my output, the problem is I don't know how to put standard errors under the mean results (to save space)
    eststo clear
    sort race
    eststo: quietly estpost summarize ///
    yearsexp honors volunteer military,
    by race: eststo: quietly estpost summarize ///
    yearsexp honors volunteer military,

    esttab, cells("mean(fmt(%12.3fc)) sd") label mtitles(Races)

    Attached Files

  • #2
    estout/ esttab is from SSC as you are asked to explain. Here is one way:

    Code:
    webuse lbw, clear
    eststo clear
    bys race: eststo: quietly estpost summarize low age smoke
    esttab,  main(mean) aux(sd) label mtitles
    Res.:

    Code:
    . esttab,  main(mean) aux(sd) label mtitles
    
    --------------------------------------------------------------------
                                  (1)             (2)             (3)   
                                white           black           other   
    --------------------------------------------------------------------
    birthweight<2500g           0.240           0.423           0.373   
                              (0.429)         (0.504)         (0.487)   
    
    age of mother               24.29           21.54           22.39   
                              (5.655)         (5.109)         (4.536)   
    
    smoked during preg~y        0.542           0.385           0.179   
                              (0.501)         (0.496)         (0.386)   
    --------------------------------------------------------------------
    Observations                   96              26              67   
    --------------------------------------------------------------------
    mean coefficients; sd in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    Comment


    • #3
      Hi, is it possible to adjust the number of decimals (of the mean and sd) in this context?

      Comment


      • #4
        Add the format within -main()- and -aux()-, e.g.,

        Code:
        esttab,  main(mean 2) aux(sd 2) label mtitles
        Res.:

        Code:
        . esttab,  main(mean 2) aux(sd 2) label mtitles
        
        --------------------------------------------------------------------
                                      (1)             (2)             (3)   
                                    White           Black           Other   
        --------------------------------------------------------------------
        Birthweight<2500g            0.24            0.42            0.37   
                                   (0.43)          (0.50)          (0.49)   
        
        Age of mother               24.29           21.54           22.39   
                                   (5.65)          (5.11)          (4.54)   
        
        Smoked during preg~y         0.54            0.38            0.18   
                                   (0.50)          (0.50)          (0.39)   
        --------------------------------------------------------------------
        Observations                   96              26              67   
        --------------------------------------------------------------------
        mean coefficients; sd in parentheses
        * p<0.05, ** p<0.01, *** p<0.001

        Comment

        Working...
        X