Announcement

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

  • Illustrative table of percentages to read in Word

    Dear Statalist,

    I would like to create a table of publication quality summary percentages.

    The column headings are 0 and 1 for the binary variable: Participation.
    The row headings are for a large number of different categorical characteristics such as ethnicity, sex and age etc.

    I can create individual tables using the following command:
    asdoc tabulate sex Participation , row nofreq replace
    asdoc tabulate ethnicity Participation , row nofreq replace
    asdoc tabulate age Participation , row nofreq replace
    etc.

    I have quite a few questions:

    How can I combine all these above tables together?
    How can I remove the total columns from the table?
    How can I add notes to the table?
    Is there a method for adding continuous variable statistics to the bottom of the table?

    I have tried using asdoc, outreg2 , esttab and tabout commands but I am really struggling to produce one complete table.

    Thank you very much
    Best wishes

    Seren


  • #2
    Hi Seren,

    I believe what you are asking for is possible with sufficient care and careful programing. If there is no combination of high level commands that produce a publishable table like the one you are requesting, then you could, in theory, take advantage of the correct set of primitives to dynamically build this table yourself. One of my mentors wrote a program that dynamically generated his entire dissertation as a laTeX file. You can do some pretty crazy things with a sufficient understanding of programing. The problem is that I suspect (although I don't know for sure) that there is no combination of high level commands that will do all of the things that you need to do to get your table. This is in spite of some of the progress Stata has made in table generation in Stata 17. I also think, in practice, taking advantage of primitives to programmatically produce your table will be so difficult and time consuming as to make it infeasible. Even if you have the time and inclination to get it done, you would end up with code that is so idiosyncratic it wont be useful to you beyond generating this single table.

    Hopefully someone here will prove me wrong and demonstrate how all of this can be done with a simple set of high level commands. There are plenty of people here more knowledgable than I am. I think its more likely that someone here will be able to get you a table closer to something you want to publish. But speaking as someone who generally loves over-engineering programing solutions, I happen to think that it is often faster and easier to make your own tables by hand.

    You might also want to look at the table builder. I don't think this will help you program a solution, but you may still find it very useful for collecting and exporting your results.

    Comment


    • #3
      Thank you very much for your helpful response.
      Seren

      Comment


      • #4
        I think what you are asking for is very close to Table1 template of asdocx, you may read an example table created by asdocx here https://fintechprofessor.com/asdocx/...tients-asdocx/
        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
          You may also want to have a look at -table1_mc- from ssc (ssc describe table1_mc) or at -sum2docx- from ssc (ssc describe sum2docx). -tabout- has a version 3 that can be found at: https://tabout.net.au/docs/home.php

          Comment


          • #6
            Thank you, the table1_mc and sum2docx commands are very helpful.

            Comment


            • #7
              Hello, I have used table1_mc to create a table. When I try to export it to word document I get the following error: maximum number of columns exceeded; limit 63.

              Please let me know if you have any advice on what to do.

              This is a sample of the code I am using to create the table:

              table1_mc, by(group) vars(age contn %4.2f \ gender cat %4.2f \ race cat %4.2f \ ) nospace missing onecol total(before)

              This is the code I am using to export it to word:

              table1_mc_dta2docx using "C:\example Table 1.docx", replace

              Thanks very much

              Comment

              Working...
              X