Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: Wish list: clear stata result screen

From   Phil Schumm <[email protected]>
To   [email protected]
Subject   Re: Wish list: clear stata result screen
Date   Mon, 8 Nov 2004 15:46:45 -0600

A small addition to the Stata Wish list: a command for "Clear stata result
screen".  I think there is no such a command (I looked hard for it).

Unless I missed it, there has not yet been any indication of why someone would want to do this. Let me suggest two possible reasons: (1) after poking around awhile with a dataset and/or changing one's mind about an analysis, one wants to look at a fresh, clean set of results without seeing what came before (I won't comment on the psychology of this, but only admit that I occasionally feel this way myself), or (2) one wants to print a clean analysis without previous mistakes and/or false starts. There may be other reasons, but off the top of my head I can't think of any.

Note that both of these objectives can easily be accomplished by using the viewer window together with log files. For example, I have a little personal command called -newlog- which does nothing more than close the current log (if one is open) and open a new log in /tmp (these files are automatically named with a datetime stamp so that all I have to type is the command name itself and so that each successive filename is unique). I also have a command called -vlog- which opens the current log in the viewer (or, alternatively, refreshes the contents of the viewer with the current log). So, if I get to a point in a session where I want to examine (or to print) a set of results by themselves, I just use -newlog- to start a new log, issue the commands whose results I wish to view (or print), and then use -vlog- to open the viewer (I can then use the "Print Viewer..." command from the File menu if I want to print the results). Very simple, very fast. Moreover, if I ever do need to go back through the contents of my results window, I don't have to scroll through a bunch of blank lines.

One final note. While it is often useful to perform part or all of a Stata session entirely interactively, I would argue that any real data analysis should always be done via one or more do-files. This is not to say that there won't be interactive moments, but once you separate the wheat from the chaff, it's almost always a good idea to move the resulting code into a do-file so that it can be replicated later on. In fact, for those with a tightly integrated text editor, the distinction between interactive and do-file begins to vanish. The point to all this, though, is that once your final analysis is in a do-file, it is then simple to open a new log, execute the file, and view (or print) the "clean" results.

-- Phil
* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index