Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: "random" seed for uniform()


From   "Wallace, John" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: "random" seed for uniform()
Date   Thu, 9 Oct 2003 11:11:57 -0700

If you're looking for truly random numbers, check out John Walker's Hotbits
resource at http://www.fourmilab.ch/hotbits/ .  It generates random numbers
from a geiger counter measuring radioactive decay of a Krypton-85 source.
Nick Cox had a suggestion for implementing the output from the Hotbits data
which I haven't implemented yet.  His suggestions is in the archives as:

Subject   st: RE: text file as source for set seed # in uniform() fnc 
Date   Mon, 11 Aug 2003 19:55:37 +0100

John Wallace
Research Associate
Affymetrix, Inc
[email protected]

-----Original Message-----
From: J. Michael Oakes [mailto:[email protected]] 
Sent: Thursday, October 09, 2003 10:02 AM
To: Statalist
Subject: st: RE: "random" seed for uniform()

Nick Cox wrote:
>
> -set seed- is documented under -help generate-
>

Thanks, I've studied it and the associated citations. I'm not interested in
wasting anyone's time. Instead I honestly don't see how the examples in the
manuals or help files answer my question. The closest (help file) example I
see is:

    . set seed 1829382
    . gen random = uniform()
    . sort random
    . local holdseed = c(seed)
    . gen unif10 = floor(uniform()*10) + 1
    . ... much later ...
    . set seed `holdseed'
    . gen same10 = floor(uniform()*10) + 1

And this does not appear to generate a "random" or an "always different"
seed. My read of the example is that it re-uses the seed saved in local
macro `holdseed'. As far as I can tell, c(seed) yields the value of seed
1829382. Am I missing something here too?

Regardless, I was simply hoping a Statalister could help me out.

- Michael Oakes
*
*   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