04.06.2013 Views

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2. Handling output<br />

<strong>Stata</strong>'s output facilities are less than optimal. In this section I show how you can use the thirdparty<br />

program NoteTab <strong>to</strong> handle output for editing and printing.<br />

The Results window<br />

The output immediately appears in the Results window. You may print all of the Results<br />

window (be careful!) or a selected part of it. However, manoeuvring is more restricted than in<br />

a text edi<strong>to</strong>r, and you can use only the mouse, not the keyboard, <strong>to</strong> highlight a section. You<br />

cannot edit its contents. If you, like me, dislike the output interruptions by -more- you can:<br />

set more off [, permanently]<br />

The size of the Results window buffer is restricted, and you only have access <strong>to</strong> the last few<br />

pages of output. To increase the buffer size (default 32,000 bytes) permanently:<br />

set scrollbufsize 200000<br />

The Viewer window<br />

This window is excellent <strong>to</strong> examine help files, see section 4. [GSW] section 3 and 17 also<br />

describe how <strong>to</strong> use it <strong>to</strong> examine and print output, but it is much <strong>to</strong>o inflexible. The SMCLformatted<br />

output is a mixed blessing, with parts of a table in bold, parts in plain text. And<br />

actually only the [GSW] manual uses SMCL-formatted output, the others use plain text.<br />

The log files and NoteTab<br />

You may generate two log files, a full log and a command log. [GSW] section 17 tells how <strong>to</strong><br />

open and close log files. That didn't work well for me; I often forgot <strong>to</strong> open a log file. Now I<br />

let the start-up file profile.do create the log files au<strong>to</strong>matically, see section 1.2.<br />

The full log (c:\tmp\stata.log) is a copy of what you saw in the Results window. I use it<br />

<strong>to</strong> inspect, edit and print output in NoteTab. I selected plain ASCII text for the full log; it is<br />

overwritten next time you start <strong>Stata</strong> or when you issue the newlog command.<br />

The nt command gives you rapid access <strong>to</strong> your output in NoteTab. See appendix 3 on how<br />

<strong>to</strong> create both commands.<br />

The command log (c:\tmp\cmdlog.txt) includes all commands issued. It is cumulative,<br />

i.e. new commands are added <strong>to</strong> the file, which is not overwritten next time <strong>Stata</strong> is opened.<br />

You may use it instead of the Review window <strong>to</strong> see and recover previous commands.<br />

Copying a table <strong>to</strong> a word processor document.<br />

You might want <strong>to</strong> use a <strong>Stata</strong> table for publication. Copying a table directly <strong>to</strong> a word<br />

processor document does not work well, but you may use Excel as an intermediary:<br />

1. Highlight the table in the Results window. Right-click it and select Copy Table<br />

2. Open Excel and paste the table <strong>to</strong> it ([Ctrl]+V). Edit the table if needed.<br />

3. Copy-and-paste the table <strong>to</strong> your document.<br />

To do the trick correctly, Windows must be set <strong>to</strong> display decimal periods (unless you in <strong>Stata</strong><br />

chose set dp comma).<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!