Announcement

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

  • esttab for descriptive statistics: Automatically blank standard deviations for dummy variables?

    Dear all:

    I would like to use -esttab- for creating a descriptives table like this:

    Code:
    sysuse auto, clear
    qui tab rep78, gen(rep78x)
    qui estpost summarize mpg rep78x*
    esttab, cells("mean(fmt(2) label(Prop./Mean)) sd(fmt(2) label(SD)) min(fmt(0) label(Min.)) max(fmt(0) label(Max.))") ///
            nogap nomtitle nonumber
    This gives me a table like this:

    Code:
    ----------------------------------------------------------------
                   Prop./Mean           SD         Min.         Max.
    ----------------------------------------------------------------
    mpg                 21.30         5.79           12           41
    rep78x1              0.03         0.17            0            1
    rep78x2              0.12         0.32            0            1
    rep78x3              0.43         0.50            0            1
    rep78x4              0.26         0.44            0            1
    rep78x5              0.16         0.37            0            1
    ----------------------------------------------------------------
    N                      74                                       
    ----------------------------------------------------------------
    My question is: Is there a way to stop esttab from including the standard deviation for dichotomous variables?

    The reason I would like to do this is a) My table is big and crowded and would benefit from fewer numbers and b) the SD of a binary variable is just a function of the mean; anyone interested in the SD can calculate the information themselves based on the mean.

    Thank you so much
    Klaus

  • #2
    Note to myself: After 1 1/2 years, I read in the help file that there is a keep() option, which does what I want, but not automatically:

    Code:
    sysuse auto, clear
    qui tab rep78, gen(rep78x)
    qui estpost summarize mpg rep78x*
    esttab, cells("mean(fmt(2) label(Prop./Mean)) sd(fmt(2) label(SD) keep(mpg)) min(fmt(0) label(Min.)) max(fmt(0) label(Max.))") ///
            nogap nomtitle nonumber

    Comment

    Working...
    X