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

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


From   Chris Ruebeck <[email protected]>
To   [email protected]
Subject   Re: st: RE: Stata vs. SAS (random number generation)
Date   Thu, 7 Apr 2005 11:36:31 -0400

I'm not terribly familiar with the literature, but if you don't want to use Tim's solution (which I think is an excellent one), then you might adapt code from Numerical Recipes (Press, Flannery, Teukolsky, and Vetterling) to Stata and SAS.

Chris


On Apr 6, 2005, at 5:56 PM, McKenna, Timothy wrote:


In general I don't think you can get SAS and Stata to do this.

A simple, although embarrassingly inelegant, solution would be to have
Stata (or SAS) generate the random numbers. Then output them to a text
file and have the other program read them in. You would need to be
careful about precision issues, but otherwise it should work fine.

-Tim

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Joao Pedro
Wagner de Azevedo
Sent: Wednesday, April 06, 2005 5:12 PM
To: [email protected]
Subject: st: Stata vs. SAS (random number generation)

Dear Statalist,

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.

I've tried setting the same seed value in both packages with no success (see example of the command and output below).
*
*   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