Announcement

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

  • Export two-way table to excel from the table command

    I have created a two-way table that I need to export to excel.

    Code:
    table var1 var2,contents(mean var3)
    I have tried the putexcel command but since the stata command "table" does not store any results it doesn't seem to work. Any advice? Since I am using putexcel to export other tables obtained from commands like summarize and reg, it will be helpful if I can maintain the putexcel command in this case as well.

    Girish

  • #2
    Girish,

    table produces a results table in the output, putexcel writes a matrix into an Excel file. Both work, but the idea of combining the two "doesn't seem to work" precisely because the table command doesn't leave a matrix behind.

    This has been discussed before: http://www.stata.com/statalist/archi.../msg01107.html

    Kevin Crow (StataCorp) has posted an article in the Stata Blog on how to write tables to Excel: http://blog.stata.com/2013/09/25/exp...bles-to-excel/

    You can write your own command following this technique if standard features are not suitable for your tasks.

    Best, Sergiy Radyakin

    Comment

    Working...
    X