Announcement

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

  • Exporting results to Excel file

    Hi, could someone please help?

    I have been trying to export the results from my one-way tabulations and summary statistics to Word/Excel files. I have successfully used the asdoc command, which is quite convenient and has saved me much time.

    However, it would be even more efficient if I could export the results into Excel files automatically. I am learning about the putexcel command, but am having troubles with it (which I have discussed in another string).

    Are there any other commands besides putexcel that I could use to export tabulation results and summary statistics into Excel? Ideally, the command would allow me to export results from multiple tabulations or summary statistics into a single Excel file, on separate sheets.

    Please kindly advise! Millions of thanks!

  • #2
    Code:
    ssc install estout, replace
    See http://repec.org/bocode/e/estout/hlp_estpost.html

    Code:
    sysuse auto, clear
    estpost tabstat price mpg rep78, listwise statistics(mean sd)
    esttab . using myfile.csv, replace cells("price mpg rep78")
    Click image for larger version

Name:	Annotation 2022-03-31 091557.png
Views:	1
Size:	20.4 KB
ID:	1657117

    Comment


    • #3
      Thanks so much Sir!

      For your information, I am currently using the following codes:

      local LFPworked_Sum "work_pearning1 work_phrs1 work_pearning2 work_phrs2 work_pearning3 work_phrs3"
      foreach var in `LFPworked_Sum' {
      estpost tabstat `var' if survey_string == "2f" & work_ever == 1, statistics (mean sd n) columns(statistics)
      esttab using Section4_LFPworked_Sum.xls, cells(mean sd n) append
      }

      It does generate the output I want into Excel =)

      However, there is one issue. The Excel file generated is a mess, totally unreadable.

      Is there anything wrong with my coding? How could I fix it?

      Millions of thanks!

      Comment


      • #4
        Copy and paste the result of

        Code:
        dataex work_pearning1 work_phrs1 work_pearning2 work_phrs2 work_pearning3 work_phrs3 survey_string work_ever

        Comment


        • #5
          What does this code do? Where should I paste it?

          Many thanks, Sir!

          Comment


          • #6
            Run it in your command window after loading your dataset and copy and paste the result to the forum.

            Comment


            • #7
              Originally posted by Cindy Li View Post
              What does this code do? Where should I paste it?

              Many thanks, Sir!
              Cindy Li , please read the FAQ. section first and familiarize yourself with the norms for posting here. Specially give attention to the use of -dataex- for providing data example and use of code delimiters for posting here in the forum. That will help others in the forum to help you out.
              Roman

              Comment


              • #8
                If you have enjoyed the convenience of asdoc, you may also like asdocx, that can export tables to Word, Excel, LaTeX, and HTML with the same convenience. You can explore more about asdocx here https://fintechprofessor.com/asdocx/pricing/ , it is currently available at a discounted price of $9.99.
                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
                  You posted a similar problem here for which a solution has been provided.
                  Roman

                  Comment


                  • #10
                    Click image for larger version

Name:	2022-04-04.jpg
Views:	1
Size:	112.0 KB
ID:	1657781


                    Hi Sir! This is what I get when I run your command!

                    Please kindly advise on how I could obtain clear and readable Excel results!

                    Comment

                    Working...
                    X