asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum by() and bysort with tabulate or tab command using asdocx

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

    Hello
    Firstly, thank you for a very versatile and easy to use tool for exporting data fra stata to other platforms! This is great!

    I want to show selected summary statistics for several variables, sorted by schools
    First I assigned labels to all schools for easier idenfitication.
    code:

    la de LABEL 1 "" 2 "" etc...
    la val MYVAR LABEL

    The:

    bysort sch_id: asdocx sum s_13-s_20, detail stat(count mean sd var cv p50 skewness) ///
     title(something in danish) font(arial) dec(2) replace save(test2.docx) tzok

    But this messes up the labels. Also the listing of the statistics doesn’t change depending on using the “bysort” or the “by” prefix….
    Is this a glitch or is this me doing something wrong?

    Rune Lomholt
    Participant
    Post count: 19

    Also i should add that all value labels are correct when only executing this command on one variable like:
    asdocx sum s_13, detail stat(count mean sd var cv p50 skewness) title(something in danish) font(arial) dec(2) replace save(test2.docx) tzok

    Dr. Attaullah Shah
    Keymaster
    Post count: 106

    I have now updated asdocx. You can now use bysort or by() with tabulate command. Here is an example:

    asdocx_update
    sysuse auto, clear
    by foreign : asdocx tab rep78, replace
    
                      Tabulation of rep78 when foreign is Domestic
      0 |1                                   2                3                4 
    ----+-----------------------------------------------------------------------------
      1 |Repair record 1978              Freq.          Percent             Cum. 
    ----+-----------------------------------------------------------------------------
      2 |1                                   2             4.17             4.17 
      3 |2                                   8            16.67            20.83 
      4 |3                                  27            56.25            77.08 
      5 |4                                   9            18.75            95.83 
      6 |5                                   2             4.17           100.00 
      7 | Total                             48           100.00                  
    ----------------------------------------------------------------------------------
       
    
                        Tabulation of rep78 when foreign is Foreign
      0 |1                                   2                3                4 
    ----+-----------------------------------------------------------------------------
      1 |Repair record 1978              Freq.          Percent             Cum. 
    ----+-----------------------------------------------------------------------------
      2 |3                                   3            14.29            14.29 
      3 |4                                   9            42.86            57.14 
      4 |5                                   9            42.86           100.00 
      5 | Total                             21           100.00                  
    ----------------------------------------------------------------------------------
    Click to Open File:  C:\temp\test2.docx
    

    I am not clear on your query related to labels. For me the lables works correctly. You must use the option label to export variable labels.

    asdocx sum price mpg rep78 headroom , detail stat(count mean sd var cv p50 skewness) ///
           title(something in danish) font(arial) dec(2) replace save(test2.docx) tzok label
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.