Announcement

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

  • New program -tw3xls- available on SSC

    New program -tw3xls- available on SSC


    Dear Stata users,

    I am thrilled to present my first publicly available Stata program -tw3xls-.
    It can be installed from SSC via
    Code:
    ssc install tw3xls
    The program allows to nicely export three-way and four-way tables into xls or xlsx.
    For now, it works only with frequency tables. The number of variables in the varlist is limited to three, one more can be added using the by(varname) option.

    The general syntax is as follows:
    Code:
    tw3xls rowvar supercolumnvar columnvar using example1, (options)
    Command options are described in the help file.
    Required minimum version: Stata 14.1 (due to some -putexcel- commands used in the ado file).


    The program itself was inspired by -tab2xl- and -tab2xl2- .
    Several words of notice:
    1) -tw3xls- works with both numeric and string values;
    2) When you use encoded variables, the output will contain numeric codes. If you want to see the labels in the output, make sure an encoded variable is decoded and contains string values;
    3) A three-way table consists of the following parts: rows, columns and supercolumns;
    4) A four-way table is defined as a set of three-way tables. For example. if there are four unique values in the by-variable, you will get four similar three-way tables in Excel, each one representing its own group;
    5) Performance degrades significantly when there is a large number of groups in the by-variable.


    I really hope you will enjoy the -tw3xls- program!
    If you have found any bugs/issues/problems or have wishes or even wish to say 'thank you' you are welcome


    A little more additional information (partly repeats the help file) with performance investigation is in the attached pdf file.
    Output examples with different types of formatting (for the sake of performance) are in the attachment.

    Kind regards,
    Andrey Ampilogov
    Attached Files
    Last edited by Andrey Ampilogov; 09 Jan 2017, 03:22.

  • #2
    For some reason, I can't change topic name, it should be:
    New program -tw3xls- : export tabulate results to Excel (three/four-way tables)

    Comment


    • #3
      -tw3xls- has been updated!
      Please type -adoupdate, update- to get the latest version.

      Added:
      + row and column totals
      + sorting output tables in ascending or descending order
      + ability to select top K elements of the output table

      Updated:
      * formatting options
      * help file

      Comment


      • #4
        This is great Andry Ampilogov.

        Just a suggestion, it would be good if you can find a way to export value labels of a variable without changing it to string.

        Comment


        • #5
          Thank you, Fahim!

          Could you explain in more details what is wrong with exporting value labels as strings? Just trying to understand the request.

          Comment


          • #6
            Thanks Andrey for this, quite helpful indeed. Now, in support of Fahim Ahmad's suggestion, I think adding value labels would help a lot in managing the data, so that one doesn't have to seek back on the label values to understand each variable/value . Food for thought.

            Comment

            Working...
            X