Statalist


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

Re: st: bug? -display- inside -simulate-


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: bug? -display- inside -simulate-
Date   Sat, 29 Dec 2007 15:28:12 -0500

Aha! That will do it.

I was thrown off because I got output on the first iteration.

thanks,
Jeph


Scott Merryman wrote:
Do you want the -noisily- and/or the -trace- option with -simulate-?

For example:

. capture program drop myprogram

. program define myprogram, rclass
  1.        di in r "myprogram"
  2.        return scalar n = 1
  3. end

.
. quietly simulate n=r(n), noisily  reps(10): myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram
. myprogram
myprogram

.
end of do-file


Scott


On Dec 29, 2007 12:47 PM, Jeph Herrin <[email protected]> wrote:
I am using -simulate- to run -myprogram-, and
would like -myprogram- to display some output
each time, for tracking purposes. The problem
is that -display- seems to only work the first
time through.

For example:

===============================================
capture program drop myprogram
program define myprogram, rclass
       di in r "myprogram"
       return scalar n = 1
end

quietly simulate n=r(n), reps(1000): myprogram
===============================================


produces the following output:

===============================================
. capture program drop myprogram

. program define myprogram, rclass
  1.         di in r "myprogram"
  2.         return scalar n = 1
  3. end

.
. quietly simulate n=r(n), reps(1000): myprogram
myprogram

.
.
.
end of do-file
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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