Announcement

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

  • Formatting Stata Results

    When writing one's own Stata commands, what is the best way to ensure that the output in the Results window is nicely formatted in tabular form and can be cut and pasted into a table. I've been using the list command to display Results, but there must be something better.

    I've also had mixed success cutting and pasting Results from other commands into a table. Not sure if the problem is me, or if some commands format Results in a friendlier way than others.

  • #2
    The output of the -list- command is typically not very friendly for pasting into tables in word processing documents, as you have noticed. Since you are apparently talking about doing this for some subset of the data set itself, take a look at the -putdocx- command (if you are using version 15.1). That will save you even the trouble of pasting, at the expense of spelling out the desired layout in code.

    For something quicker, and that will work in older versions of Stata as well, just -browse- the desired variables and observation numbers, and the copy/paste from the Browser window into your document.

    For output of commands, as opposed to blocks of the data, again, -putdocx- is a good approach in version 15.1. If running an older Stata, look at what results are available in r() or e() after the command executes, and then use the -display- command to format it in the desired way, and then copy/paste to your document.

    Comment


    • #3
      This kind of question calls forth as many kinds of answers as can be imagined. For example, it's by no means axiomatic that everyone uses the same operating system or word processing or text processing program(s), but there's nothing in #1 to say what you are using. Those using some flavour of *TeX or HTML or some other mark-up language will have different answers.

      For my part, I wouldn't knock list so readily. If you can list results then they're data and direct export of data can be just as useful as working at layout and presentation within Stata.

      Cut and paste != copy and paste.

      Comment

      Working...
      X