Announcement

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

  • Add row total to frequency table with asdoc

    Hi all,

    I am trying to Add the row total to a frequency tably when I am using asdoc, the original table from stata:

    Code:
    
    sysuse auto
    tab foreign
    
       Car type |      Freq.     Percent        Cum.
    ------------+-----------------------------------
       Domestic |         52       70.27       70.27
        Foreign |         22       29.73      100.00
    ------------+-----------------------------------
          Total |         74      100.00
    But the asdoc table result in a word doc:
    Code:
    asdoc tab foreign
    Click image for larger version

Name:	Sin título.png
Views:	1
Size:	4.9 KB
ID:	1504429


    You can see that in the last table miss the total row. Do you know how get it with asdoc?
    Thanks in advance

  • #2
    Using Stata 15.1 on macOS, after running
    Code:
    ssc install asdoc
    my results were identical to yours when opened in Microsoft Word for Mac version 16.26, saved either as a .doc or as an .rtf. I believe that is not what was intended; asdoc iis generally faithful to the output of the Stata command.

    Perhaps the author of asdoc Attaullah Shah who is a frequent contributor to Statalist will see this topic and comment on it.
    Last edited by William Lisowski; 22 Jun 2019, 19:03.

    Comment


    • #3
      I got half sucess trying with:

      Code:
      sysuse auto
      asdoc tab foreign
      asdoc, row(Total, `r(N)')
      Lamentably I could not format the position of frequency:

      Click image for larger version

Name:	Sin título.png
Views:	1
Size:	5.6 KB
ID:	1504436



      Comment


      • #4
        I have revised asdoc. 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.

        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.

        Example of the new feature
        Code:
        sysuse auto, clear
        asdoc tab rep78 , replace
        Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	16.4 KB
ID:	1504522
        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


        • #5
          Thanks Professor Attaullah Shah for your good disposition.

          Your work help much to my work. I will remeber cite you in the future.
          Last edited by Rodrigo Badilla; 23 Jun 2019, 16:37.

          Comment


          • #6
            Please I need help. With the previous version of asdoc it did not show the total of the table and when installing from its website it shows me this error.


            . asdoc tabulate region_spinal, append

            region_spin |
            al | Freq. Percent Cum.
            ------------+-----------------------------------
            1 | 3,017 32.73 32.73
            2 | 975 10.58 43.31
            3 | 193 2.09 45.40
            9999 | 5,033 54.60 100.00
            ------------+-----------------------------------
            Total | 9,218 100.00
            asdoc_tab_onevar(): 3001 expected 13 arguments but received 14
            <istmt>: - function returned error
            r(3001);

            Comment


            • #7
              My stata version is 13.1

              Comment


              • #8
                The error message implies that the installation was partially successful. Please reinstall it from

                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.

                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


                • #9
                  Thanks, congratulations is very good !!!!

                  Comment


                  • #10
                    Hello Professor Shah @Attaullah Shah,

                    I used the following code:

                    Code:
                    asdoc tab CarerHrs DvEcoStat3, ce ro co replace
                    While the frequency of each cell, column and row don't seem to appear on the word file, only counts appear. Any suggestion on this is much appreciated.

                    Best wishes

                    Comment


                    • #11
                      I am using the latest version of asdoc (Version 2.3.9.1 : Changes made on Nov 3, 2020). 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.

                      Following is an example:

                      Code:
                      sysuse nlsw88
                      
                      asdoc tab industry collgrad, cell row col replace
                      Please do remember to cite asdoc. To cite:
                      Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	74.9 KB
ID:	1585326




                      asdocx is now available, see details here https://fintechprofessor.com/asdocx/. asdocx is more flexible and powerful.

                      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.
                      Last edited by Attaullah Shah; 09 Dec 2020, 23:55.
                      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


                      • #12
                        Originally posted by Attaullah Shah View Post
                        I am using the latest version of asdoc (Version 2.3.9.1 : Changes made on Nov 3, 2020). 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.

                        Following is an example:

                        Code:
                        sysuse nlsw88
                        
                        asdoc tab industry collgrad, cell row col replace
                        Please do remember to cite asdoc. To cite: [ATTACH=CONFIG]n1585326[/ATTACH]



                        asdocx is now available, see details here https://fintechprofessor.com/asdocx/. asdocx is more flexible and powerful.

                        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.
                        Dear Professor Shah @Attaullah Shah,

                        Thanks for your reply. As we can see from the table you presented, there are counts, row frequency and column frequency, while the 'cell' option in the command is not shown on the table. Is it possible to get the 'cell' option captured by asdoc?

                        Best wishes

                        Comment

                        Working...
                        X