Statalist The Stata Listserver


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

st: RE: Re: Seed and time


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: Seed and time
Date   Mon, 26 Feb 2007 22:05:18 -0000

This is the sense in which I meant to include time. I did 
not mean in the sense of any system time, but of how many 
calls you have made to the generator since -set seed-. 

By far the easiest way to ensure reproducibility 
is to -set seed- immediately before calling up the 
generator. 

Poor wording on my part, evidently. Sorry about that. 

Nick 
n.j.cox@durham.ac.uk 

Sergiy Radyakin
 
> Setting seed is enough:
> 
> . set seed 1
> 
> . di uniform()
> .66818523
> 
> . di uniform()
> .92796107
> 
> . di uniform()
> .48448141
> 
> . set seed 1
> 
> . di uniform()
> .66818523
> 
> However, if you initially set seed to be equal to current 
> time (rather then 
> the constant 1 here) than time matters.

SamL

> > Just a clarification requested.  Nick Cox just seemed to 
> indicate that to
> > replicate using seed one needs to also reference time.  Have I
> > misunderstood?  Or is time an alternative way to obtain a 
> seed when one
> > does not care what it is?  I guess I just want to assure 
> that setting seed
> > *sets* the seed so that it replicates any other run with 
> the same seed,
> > regardless of the time.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index