[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Re: log only results of r-class commands

From   "Dr. Stephen Rothenberg" <>
To   <>
Subject   st: Re: Re: log only results of r-class commands
Date   Wed, 28 May 2008 17:28:42 -0500

To close out this thread:

I appreciate the helpful responses of Maarten Buis, Sergiy Radyakin and Roy Wada.

Offline, Roy sent me a copy of each of the programs he had written along with an a do-file illustrating their use. Though his program -sumout.ado-, emulating -outreg2-, produced beautifully formatted tables with summarize-like output, it does not at present allow the option of listing variable labels instead of variable names in the first column.

His program, -logout.ado-, when run in a do-file with additional user-specified commands, does exactly what my original question asked. The do-file with -logout- effectively strips command output from an existing text file created from the log, cleans up horizontal dashed lines from output, allows selected comments from the do-file to remain as titles to the output produced by any command in the do-file, preserving variable labels from the -fsum- command, all optionally specified in the do-file by defining the appropriate tokens. -outfile- works by digesting a log-file in text format, outputting it as a tab-delimited data file and doing the cleaning from that data file. By using -outfile- in the do-file, the cleaned up data file can be exported as a text file, giving the desired result.


----- Original Message ----- From: "Dr. Stephen Rothenberg" <>
To: <>
Sent: Saturday, May 24, 2008 1:18 PM
Subject: st: Re: log only results of r-class commands

Looks like the best strategy would be to try both your programs and see which best suits the purpose. You're correct, I'd prefer several large tables to many small tables, but this is for an appendix, where the requirement is to show the stats, so I'm not picky on format. I'll hand-craft the tables that appear in the body of the report.

I'm not sure from what you say if your program based on -outreg2- makes a call to
-outreg2- and thus wouldn't work with the current version of -outreg2- or if it emulates some features of -outreg2- and so in its current version would not have all the bells and whistles of the latest -outreg2-.

If the latter, I'd appreciate the opportunity to try both solutions, either through an ssc download (although at this hour isn't responding to Stata calls from my location) or through an attachment to my email address in the header.

In either case, I'll post to Statalist the results of my trials.


From    Roy Wada <>
To    <>
Subject    st: Re: log only results of r-class commands
Date    Fri, 23 May 2008 16:55:01 -0700

The descriptive analysis extensively uses -fsum- (fsum.ado Full
SUMmary program v 2.4.0 fw 2may05), contributed by Fred Wolfe,
as it prints variable labels instead of variable names.

I would like to preserve the comments in the log, since they identify
analyses, but could live without that feature. Far easier to add a few
table headers to table groups than to edit out hundreds of lines of
command code.

What you want is to clean up log files or produce tables. I have programs
for both, but it usually comes out to be the same thing.

I have a program based on -outreg2- that can produce tables of
summary statistics. It will handle labels, titles, notes, blah, blah.
It is byable, but only column-wise. The problem is that it would
have to be upgraded to the newer version of -outreg2- that is
more flexible. Like -outreg2-, this method can produce one huge
table or many small table files. You might not like many small

The other program is designed to chew up log files in text format.
It is capable of digesting numbers and dumping them into tab-delimited
format (xml, dta). A log file is much easier to clean after being imported
as a data file, because you would say something like: drop if v0=="/*".
The problem is that tab-limited files may not be what you want, which in
case you would also import un-tabbed file, and export that column after
you have finished dropping what you didn't want using the information
from tab-limited columns.


*   For searches and help try:

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