Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: how to use for* loops "noisily"?

From   "Martin Weiss" <>
To   <>
Subject   st: RE: how to use for* loops "noisily"?
Date   Thu, 29 Jul 2010 18:19:17 +0200


" I experimented with turning -set trace on-, but it did more harm than

What kind of harm does -set trace on- do? Yo can -set- the -tracedepth- and vary it until you get reasonable results. I always -log- the whole thing, have it -translate-d to pdf (on a Windows machine, via Miktex utilities), and then search for keywords in the pdf. Most of the time, this leads to success for me. Here is my template to do this:

//to log in an additional log and have it transferred to pdf

//can set -linesize-
set linesize 120

//close if open
capt log close newlog
di in red _rc

log using mylog.smcl, name(newlog) replace
//do whatever you want in the log

//trace the thing with Ben Jann`s tool

//or use conventional set trace on/off
//set trace on

//set trace off

log close newlog

translate mylog.smcl, replace
//need Miktex utilities running on computer for this step
capt erase
!start mylog.pdf


-----Original Message-----
From: [] On Behalf Of László Sándor
Sent: Donnerstag, 29. Juli 2010 18:06
Subject: st: how to use for* loops "noisily"?

Hi all,

Sorry I could not google this down (or find in the manual): I am
trying to use some efficient code, much like the advice of Kit Baum's
books and Stata tips, but if I use loops (-foreach- or -forvalues-)
for everything (cases, specification, restrictions etc.), I rarely see
anything going on, only estimation results are coded to get
posted/displayed in this case [by Stata], and the occasional (=
omnipresent) error message.

I experimented with turning -set trace on-, but it did more harm than
good. Some clumsy bracketing into -noisily- chunks did not help

Is there something to do if I'd like to run this do-file as a regular
do-file for all commands, in or out of loops?


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index