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

Re: st: Stata vs. SAS (random number generation)


From   Daniel Feenberg <feenberg@nber.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Stata vs. SAS (random number generation)
Date   Thu, 7 Apr 2005 07:19:46 -0400 (EDT)

On Thu, 7 Apr 2005, Joseph Coveney wrote:

> Joao Pedro Wagner de Azevedo Wrote (excerpted):
> 
> I would like to know if it is possible, and if so how, to have Stata and SAS
> generating the same sequence of random numbers. 
> 
> --------------------------------------------------------------------------------
> 
> Given a seed, if you know the package's algorithm, shouldn't it be possible to 
> reproduce its sequence of pseudorandom numbers?  

I think most random number generators are designed to be as sensitive to a
change in the last bit as to a change in the first bit. So unless the
arithmetic were identical in both cases, the sequence should diverge the
first time a rounding decision goes differently (which might not happen,
of course - integers, IEEE floats, same hardware).


> 
> Stata reveals its algorithm in its manuals.  SAS probably does the same in 
> sufficient detail somewhere in its documentation to be able to reproduce its 
> sequences.
> 
> Joseph Coveney
> 
> 
> *
> *   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/
> 


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