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

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


From   "J. Michael Oakes" <[email protected]>
To   Statalist <[email protected]>
Subject   st: RE: "random" seed for uniform()
Date   Thu, 09 Oct 2003 12:02:06 -0500

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