Statalist


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

Re: st: how to cancel the seed set previously?


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: how to cancel the seed set previously?
Date   Thu, 02 Jul 2009 10:29:20 -0400

In addition to the advice of the others, I'll note
that when I want a "random" seed - to get a "random"
sequence of random numbers, I do something like:

    local time=c(current_time)
    local seed : subinstr local time ":" "", all
    set seed `seed'

So each time the code runs, the seed is set to the
hour-minute-second combination. However, as Maarten
explained, there aren't many situations you'd want to
do this.

Jeph




[email protected] wrote:
I set seed # before the runiform() function. For instance, I typed, set seed 100 g x=runinform()

my confusions are, 1.how to set the seed number propriately? I saw
everyone set it large.Any difference? 2. how to cancel the seed set
previously? Maybe next time I again want to produce uniformly
distributed random variates, and set seed 100 by accident , which may
lead to the variates produced is not random.

Thank you for any replies!

Sincerely, from Rose.

* *   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/

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