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   "JP Azevedo" <jazevedo@provide.com.br>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Stata vs. SAS (random number generation)
Date   Thu, 7 Apr 2005 00:20:55 -0300

Many thanks you all for the valuable comments and suggestions.

I did a little bit of more digging, and found out that the references on the
"pseudo-random number generator" on the Stata 8 manuals and the SAS 5
manuals are quite different. 

While Stata talks about using George Marsalis (1994) 32-bits pseudo-random
number generator, SAS actually has two different functions RANUNI [Fishman
and Moore, 1982] and UNIFORM [Lewis, Goodman and Miller (1969) and Kennedy
and Gentle (1980)].

Unfortunately the SAS manuals did not present a section with the full
references, and the Stata one only said:

Marsaglia, G (1994). Personal communication

I would like to know if anyone familiar with this literature could advise me
how feasible it is to create a compatible pseudo-random number generator
which would be compatible across these two packages?

Cheers,

JP




-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Joseph Coveney
Sent: 06 April 2005 22:05
To: Statalist
Subject: Re: st: Stata vs. SAS (random number generation)

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?  

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