asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Trailing zeros but only for certain columns

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Rune Lomholt
    Participant
    Post count: 19

    Hello

    Is it possible to allow trailing zero for certain columns in summary statistics?

    I use the following code:
    bysort sch_id: asdocx sum s_7, detail stat(count mean sd var cv p50 skewness) title(title) font(Arial) dec(2)

    I want to allow trailing zeros with 2 decimals point for all columns, except count and p50…. But, I am unsure on how to do this!.

    Again, thank you for a great tool. This makes the dissemination of data fra stata much easier!

    Dr. Attaullah Shah
    Keymaster
    Post count: 106

    You can control decimal points for each column separately using the option c#_dec(). The # is column number and dec(#) sets the decimal points. In your case, count and p50 are in column 2 and 7, therefore, we shall use c2_dec(0) and c7_dec(0). Since you wish to report zero decimal points in these columns, therefore we shall use dec(0).

    sysuse auto, clear
    
    bysort foreign : asdocx sum price , detail stat(count mean sd var cv p50 skewness) ///
    title(title) font(Arial) dec(2) replace tzok c2_dec(0) c7_dec(0)
    
    
      0 |1                    2          3          4           5         6         7           8 
    ----+------------------------------------------------------------------------------------------
      1 |foreign              N       mean         sd    variance        cv    Median    skewness 
    ----+------------------------------------------------------------------------------------------
      2 |Domestic            52    6072.42    3097.10  9592054.92      0.51      4783        1.78 
      3 |Foreign             22    6384.68    2621.92  6874438.70      0.41      5759        1.22 
    ------------------------------------------------------------------------------------------------ 
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.