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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Saving matrices with -simulate-


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Saving matrices with -simulate-
Date   Mon, 9 May 2011 10:30:57 -0400

Bert Jung <bjung59@gmail.com>:
If you make your program rclass and return everything as scalars,
including coef estimates, you can easily get everything out.  Make
sure your program ends with
. eret clear
and then -simulate- will automatically keep all the r() contents.
Note also that resetting the seed inside the program is a very bad
idea and often destroys any good qualities of the pseudorandom number
generator.  You can get the current seed from c(seed) instead.

On Sun, May 8, 2011 at 12:24 PM, Nick Cox <njcoxstata@gmail.com> wrote:
> I guess you could change your -myboot- so that it leaves extra stuff
> somewhere else, e.g. using -postfile-.
>
> On Sun, May 8, 2011 at 4:25 PM, Bert Jung <bjung59@gmail.com> wrote:
>
>> I am using -simulate- to write a bootstrap routine.  In addition to
>> the usual statistics (coefficient estimates), I would like -simulate-
>> to save additional information that my program returns as a matrix.
>>
>> In the following toy example, -myboot- returns the coefficients and a
>> matrix "seed" with the random seed that I created inside the program.
>> But "seed" is not saved in every bootstrap iteration; -simulate- only
>> saves the coefficients.  (This is just for illustration, of course.)
>>
>> Thanks for any pointers.
>>
>> Best, Bert

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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