Announcement

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

  • Export a table in a descriptive statistics/reg format to doc file

    Hello,

    I am trying to export my statistics table to doc, in a "publication format".
    I have:
    • income data (monthly income, income decile etc)
    • several groups (treatment/control, female/male, low-education/high-education), in total 8 groups
    I want to create a table which summarize all the income statistics (mean, median and standard error) by relevant group (e.g group1 = treatment_female_LowEducation).

    Unfortunately I cannot find any elegant way to do so.
    I cannot figure how to use outreg2 in such way, nor how to export a table command output into a nice-looking table in .doc file

    Anyone know how to address it?

    Thank you very much,
    Brit



  • #2
    I forgot to mention:
    1. I have one more dimension: years (2004-2010)
    2. I am working in a classified computer station, hence I cannot upgrade or install packages.

    Comment


    • #3
      There have been many discussions of creating descriptive statistics on this listserv. Search through them to see if any help you.

      If you can't add user written programs, look at the Reporting documentation for Stata 16. It may help.

      Comment


      • #4
        Per Phil's comment, the user-written packages are the easiest solution by far. When you say you can't install packages, do you mean that you can't even install a package into your PERSONAL directory? See https://it.iac.gatech.edu/how-to/66 for a description of doing such a thing. If this is possible for you, you definitely should try one of the user-written packages, per Phil's suggestion. -table1- is one such package that might be useful. If you can't do this, you could program something yourself with the built-in -putexcel- or -putdocx- commands, but that would be relatively difficult.

        Comment


        • #5

          Dear Phil and Mike,

          Thank you very much for your suggestions.

          The working station is completely isolated - I don't have any option to connect any external device nor to change anything in the C:\Program Files\.
          moreover, I have a very limited access - only to a specific directory in a driver.

          I thought about creating a different dummy variables to each one of the groups: female, male, low_educ, high_educ, female_low_educ, male_low_educ, female_high_educ, male_high_educ.
          And to create a different table for each relevant data information: 1.monthly_income 3. income_percentile 4.work_months

          I wish the table to look like, for example:

          Monthly income table:
          female male low_educ high_educ male_low_educ
          2004 mean 1000
          2004 median 800
          2004 sd 150
          2004 N 500000
          2005 mean
          2005 median
          2005 sd
          2005 N
          The truth is that I don't need only three tables, but I need to duplicate them by other conditions (for example, income table only for those who graduated before 2003), and as said, to export it in a publication format.
          I tried to use the -putdocx- command but I couldn't figure how to use it after creating such table in a -table- command. I did look at the help directory and searched online and in the forum for code suggestions, but my implementation didn't go well.

          Also, using dummies for each dimension limits the use of -table- command (it's too many variables).
          Would you agree to refer me to a more specific code? or to such similar example?

          Thank you so much again,
          I really appreciate it,

          Brit




          Comment


          • #6
            I have not worked with the -put...- commands except trivially, so I'm not in a position to help. There have been a number of postings about such things here and I think (?) perhaps on the Stata Blog as well, so you might try searching the archives and see what you turn up.

            Comment


            • #7
              Nothing terribly difficult as the dimensions of the table seem to be conveniently growing sideways with fixed number of stats and predictable or likely known number of years. So not like one command will give you the publication-quality output right away, but with some programming is very much doable.

              Necessary stats are given by the summarize and centile commands. The rest is looping over various combinations of inputs and stitching the columns together.

              As for the publication format, I wouldn't worry about that at the beginning. As you are working on a restricted machine, your simpler outcome would be to calculate the stats there, dump them into a file/log-file, which you pick and then post-process on your machine for formatting.

              Comment

              Working...
              X