Announcement

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

  • Export nested cross-tabulation (three variables) via "table" command

    Hi everyone,

    I'm currently facing the challenge of exporting a nested cross-tabulation (three variables) with weighted data via the "table" command to Excel in a reasonably sensible manner. Normally, I use the "tabout" command for this, but it seems to only work for cross-tabulations with two variables. I've considered using the "putexcel" command, but this seems relatively laborious and, to my knowledge, is more intended for matrices, for example, after regression analyses. Do you possibly have any idea how I could export my tables to Excel?

    My syntax is: table (var1) (var2 var3) [aweight=name_weight]

    (I am using Stata 17.0)

    Thanks in advance. Sara

  • #2
    Based on your question I assume you got the table you wanted in Stata, and only want to know how to get that table to Excel. If that is incorrect, than tell us.

    After the table command you add a new command collect export file_name.xlsx, replace where file_name.xlsx is whatever file name (and path) you like, but keep the extension .xlsx as that tells Stata you want to export the file to Excel.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Dear Maarten,

      thanks for your answer. And yes, this is correct. And wow, that was very easy and made me happy right now

      Comment

      Working...
      X