Announcement

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

  • Exporting three/four way table to excel or exporting multiple tables at once

    Hello all,

    I am looking for methods of exporting complex three and four way tables to excel, or exporting multiple tables simultaneously if using the by command. I successfully use tab2xl for most crosstabs with no problems. However that does not cover tables which use super columns or the like. Moreover, my plan is to use the by command to generate multiple tables at the same time is there a way to export them all into an Excel doc with one command. This is the example code below that would generate multiple three way tables. Is there a way to export them all simultaneously?


    bysort DEM01B: table ETHNICITY2 DEM02 SEXORIENT, contents(freq)


    I can forgo the use of by and do that manually with an 'if' if necessary. But would still like to know if it possible to export three way tables to excel. So any advice appreciated I use Stata 16 so the collect command is unavailable sadly.

  • #2
    Cross-posted at https://www.reddit.com/r/stata/comme..._to_excel_and/ Please note our policy on cross-posting, which is that you should tell us about it.

    If this were my problem i would

    Code:
    contract  DEM01B ETHNICITY2 DEM02 SEXORIENT
    and then ask an Excel expert how to produce a table from the resulting frequencies.

    Comment


    • #3
      There is a user-contributed command called -tw3xls- (SSC) which might fit the bill. I haven't used it so cannot comment on its functionality but it is specifically for three- and four-way tables to Excel output.

      Comment


      • #4
        asdoc (ssc) can send the table to MS Word, whereas asdocx (available for $9.99) can export it to Word, Excel, LaTeX, and HTML; and can do much more. Here is an example
        Code:
        webuse nlsw88
        asdocx table industry married south  , save(m.xlsx) contents(freq)
        Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	52.6 KB
ID:	1647112
        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

        Working...
        X