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

Re: st: Saving intermediate results (variables) when running -simulate-

From   Maarten buis <>
Subject   Re: st: Saving intermediate results (variables) when running -simulate-
Date   Thu, 23 Aug 2007 08:04:41 +0100 (BST)

--- Rachel <> wrote:
> If I understand this correctly, the estimates resulting from the
> simulation below should be the same for all 20 repetitions if the
> same seed is used for each one.

That would be true, but that is not what I have done in the example, or
what I advised you to do. If you look at the example (and actually
execute it, you will see it from the results) you will see I set the
seed only twice: once for generating the original 20 simulations, and
once for reproducing the 20 datasets. So I proposed that you set the
seed, than create 20, or 100, 1000, or whatever number of different
random datasets. In that case you can recreate all those datasets just
by setting that original seed again. What I did not propose is that you
set the seed for each random dataset is created, as that would indeed
lead to 20 identical datasets. In other words, -set seed 12345- should
appear outside the loop not inside the loop.

> Would it make sense to set the seed itself to be a random number and
> then return the seed as a scalar so that the rest of the dataset
> could be reproduced?

No, that is unnecesary.

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Want ideas for reducing your carbon footprint? Visit Yahoo! For Good
*   For searches and help try:

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