LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 28 Jun 2004 10:55:13 -0400
Reply-To:     "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject:      Re: Independent Random Numbers
Comments: To: Bruce Bradbury <BruceBrad@INAME.COM>

On Mon, 28 Jun 2004 05:50:04 -0700, Bruce Bradbury <BruceBrad@INAME.COM> wrote:

>I want to generate two independent random uniform numbers in a data >step. That is, independent of each other and without serial >correlation. > >I see in the SAS online doc how to do this by using different seed >variables and the call ranuni statement. However, in this case I want >to use clock-initialised streams for both vectors of random numbers. >Is there a simple way of doing this?

Hi, Bruce,

I have some codes, which I believe generate 100 observations with two independent random variables, x1 and x2... but I am not quite sure. :-)

The idea is to use two call ranuni's with different seeds. The thing I am not sure is that if they are serially correclated or not, since the two seeds are derived from the same random number stream generated by the ranuni() function. :-/

Cheers, Chang

data one; seed1 = int(1e4*ranuni(0)); seed2 = int(1e4*ranuni(0)); do i = 1 to 100; call ranuni(seed1,x1); call ranuni(seed2,x2); output; keep x1 x2; end; stop; run;

/* check corr */ proc corr data=one; var x1 x2; run;


Back to: Top of message | Previous page | Main SAS-L page