Announcement

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

  • Export summary statistics to excel or word

    Hi there,

    I can't seem to find a command to export summary statistics from stata to word. Is there a way? I know about "outreg2" for regression but not sure for summary statistics.


    Thanks!


    Best Regards,


    Andy

  • #2
    Hi Andy,

    You might explore the 'putexcel' command. It is really useful for saving your results in excel. Depending on what you want to do, the command details can differ a little bit.
    Here are two interesting blogs about this topic.
    http://blog.stata.com/2013/09/25/exp...bles-to-excel/
    http://statadaily.com/2014/07/19/put...eat/#more-1567
    Hoping this can help you, Françoise

    Comment


    • #3
      I would also recommend checking out the functionality provided by Ben Jann's wonderful estout/esttab suite. See e.g. http://repec.org/bocode/e/estout/estpost.html

      Comment


      • #4
        There are Mata functions available to construct MS Word documents built in to Stata. See:

        Code:
        help mf__docx
        Also: [M5] docx*( ) — Generate Office Open XML (.docx) file

        Comment


        • #5
          Hi again!

          I did

          Code:
          
          sysuse auto
          
          estpost summarize x1 x2 x3

          And I get "no data in memory will be lost"

          So I am not really sure what to do!


          Thanks


          Andy


          Ps: I am trying to import to word a table with all the means, min, max of my variables in my dataset

          Comment


          • #6
            You get this error since you have data in memory. Before starting your simulations to learn the estpost package on the the system file auto.dta., make sure you saved your data and then you can clear the memory.

            Code:
             sysuse auto, clear  
             estpost summarize price weight rep78 mpg   
             esttab, cells("count mean sd min max")

            Comment


            • #7
              Thanks oded!


              hmmm strange I now get " command estpost is unrecognized"

              Do I have to install something first?

              Thanks !

              Best,

              Andy

              Comment


              • #8
                I can't say much but maybe try to install it again.
                Code:
                 
                 ssc install estout, replace

                Comment


                • #9
                  Thank you very much for these posts. They help me a lot. I have more question: How to get the summary table by categories, say by year?
                  Last edited by Linghui Han; 16 Dec 2017, 15:48.

                  Comment


                  • #10
                    sum2docx, if you are using Stata 15

                    Comment

                    Working...
                    X