Announcement

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

  • Problem with "asdoc" and the order of the categories

    Hi,
    I have a problem with asdoc, I hope you can guide me.
    The correct tab (with sum) is as follows:
    Click image for larger version

Name:	1.PNG
Views:	1
Size:	27.0 KB
ID:	1622456
    but when I use asdoc (in different ways) the categories of the variable "region" get messed up. For example:
    Click image for larger version

Name:	3.PNG
Views:	1
Size:	27.4 KB
ID:	1622457 Click image for larger version

Name:	2.PNG
Views:	1
Size:	27.1 KB
ID:	1622458

    I hope you can help me identify the error.
    Thanks

  • #2
    Here is a simple reproducible example that confirms the problem, which as your example suggests, seems to be related to value labels that are not in alphabetical order as the values increase. Perhaps the author of asdoc will be able to comment on this.
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(cat val)
    1 10
    2 20
    3 30
    end
    label values cat CAT
    label def CAT 1 "A", modify
    label def CAT 2 "C", modify
    label def CAT 3 "B", modify
    
    tabstat val, stat(mean) by(cat)
    
    net install asdoc, from(http://fintechprofessor.com)
    which asdoc
    
    asdoc tabstat val, stat(mean) by(cat)
    Code:
    .
    . tabstat val, stat(mean) by(cat)
    
    Summary for variables: val
    Group variable: cat
    
       cat |      Mean
    -------+----------
         A |        10
         C |        20
         B |        30
    -------+----------
     Total |        20
    ------------------
    
    .
    . net install asdoc, from(http://fintechprofessor.com)
    checking asdoc consistency and verifying not already installed...
    installing into /Users/lisowskiw/Library/Application Support/Stata/ado/plus/...
    installation complete.
    
    . which asdoc
    /Users/lisowskiw/Library/Application Support/Stata/ado/plus/a/asdoc.ado
    *! Attaullah Shah; [email protected]
    *! Tenured Associate Professor at the Institute of Management Sciences, Peshawar, Pakistan.
    *!-------------------------------------------------------------------------------
    *! Version 2.3.9.5 : Changes made on April 10 , 2021   : Bug fixed in sum command when a variable had all empty values
    ...
    
    .
    . asdoc tabstat val, stat(mean) by(cat)
    cat
    
                 |       val
    -------------+-----------
               A |        10
               B |        20
               C |        30
    (file Myfile.doc not found)
    Click to Open File:  Myfile.doc
    
    .
    Click image for larger version

Name:	Screen Shot 2021-08-09 at 7.23.23 AM.png
Views:	1
Size:	23.2 KB
ID:	1622492

    Last edited by William Lisowski; 09 Aug 2021, 05:33.

    Comment


    • #3
      Attaullah Shah - Apologies for having not included this link in the previous post about asdoc, but I have been having problems adding links to my posts.

      Comment


      • #4
        William Lisowski Thanks for tagging me in the post. I have fixed the issue. The new version of asdoc can be installed from my site. Copy and paste the following line in Stata and press enter.
        Code:
        net install asdoc, from(http://fintechprofessor.com) replace
        Please note that the above line has to be copied in full. After installation of the new version, then restart Stata.
        I shall send an updated version to SSC.
        Code:
        asdoc tabstat val  , stat(mean ) by(cat) replace
        Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	28.2 KB
ID:	1622669


        asdocx is now available
        A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

        https://fintechprofessor.com/asdocx


        Please do remember to cite asdoc. To cite:

        In-text citation
        Tables were created using asdoc, a Stata program written by Shah (2018).

        Bibliography
        Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.
        Regards
        --------------------------------------------------
        Attaullah Shah, PhD.
        Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
        FinTechProfessor.com
        https://asdocx.com
        Check out my asdoc program, which sends outputs to MS Word.
        For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

        Comment

        Working...
        X