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

Re: st: reproducibility of rndbin - set seed

From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: reproducibility of rndbin - set seed
Date   Fri, 26 Mar 2004 19:28:52 -0500

At 10:32 PM 3/26/2004 +0000, David Schriger wrote:
Dear StataListers,

The following .do file produces different results for xb each time run.

set seed 4530754024
rndbin 10000 .363328 262
summ xb, d

Since the rndbin command invokes uniform() I thought that setting the seed would make the program produce identical results.
What am I missing? Did seed not exist in version 3.1
Type -help version- for details. Basically, there are two random number generators in Stata, the "old" one (Stata 3.1 and earlier) and the "new" one. I believe what is happening is that you are setting the seed for the new version but you need to set it for the old version. So, change your set command to either

set seed0 4530754024

or else

version 3.1: set seed 4530754024

Both worked when I just tried it. Also, I notice there are a couple of versions of rndbin floating around, so you might double-check to make sure you have the latest (I'm guessing it is package rnd from

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal):
WWW (department):

* For searches and help try:

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