BookmarkSubscribeRSS Feed
ebmancha
Calcite | Level 5

Hello,

The change in random number generators between 9.2 and 9.3 is giving me some problems.  Specifically, I need to replicate the random number generation process in 9.2 (using ranuni), while using the 9.3 software.  I found a link a while back that claimed to have code to do this, but it became inactive before I could test it.  Does anyone have experience with this?  Specifically, I need to be able to validate that samples generated using 9.2 were done correctly, while having access to only the 9.3 software.

Thanks!

4 REPLIES 4
Reeza
Super User

What does your SAS 9.2 code look like? Did  you use the streamint function in 9.2 as well?

ebmancha
Calcite | Level 5

just your standard ranuni:

proc surveyselect data = frame 

          out = pj.sample  samplesize = 80  seed = 20047

run;

or, ranuni within a datastep.

Emma

ebmancha
Calcite | Level 5

and no, never used teh streamint function. 

Rick_SAS
SAS Super FREQ

Back in the 9.2 days PROC SURVEYSELECT used the RANUNI algorithm, as documented here:

SAS/STAT(R) 9.2 User's Guide, Second Edition

In your example, the PROC uses the default sampling method, which is SRS (simple random samples without replacement). The doc says that "PROC SURVEYSELECT uses Floyd’s ordered hash table algorithm for simple random sampling....  See Bentley and

Floyd (1987) and Bentley and Knuth (1986) for details."  So I'd look up the algorithm and use the RANUNI function in the SAS 9.3 DATA step to try to recreate the 9.2 behavior.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1610 views
  • 0 likes
  • 3 in conversation