BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shawn123
Obsidian | Level 7

Hi. I have a question regarding the sentence below:

"The RANUNI function returns a number that is generated from the uniform distribution on the interval (0,1) using a prime modulus multiplicative generator with modulus 2 31− and multiplier 397204094 (Fishman and Moore 1982) "

 

I am confused about the meaning of uniform distribution? How can I understand the random number is generated from the uniform distribution on the 0 to 1 interval. Does it mean the random numbers cannot be 0.1 and 0.08?

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Uniform distribution means that any decimal between 0 and 1 has an equal likelihood of being selected. If you plotted say 1,000 random numbers in say buckets of 0.1 then the frequency in each bucket should be roughly the same, that is 100 in each bucket. It is quite possible for any decimal between 0 and 1 to be selected including 0.1 and 0.08.

 

Why don't you test this function for yourself and you will soon see how it works.

View solution in original post

1 REPLY 1
SASKiwi
PROC Star

Uniform distribution means that any decimal between 0 and 1 has an equal likelihood of being selected. If you plotted say 1,000 random numbers in say buckets of 0.1 then the frequency in each bucket should be roughly the same, that is 100 in each bucket. It is quite possible for any decimal between 0 and 1 to be selected including 0.1 and 0.08.

 

Why don't you test this function for yourself and you will soon see how it works.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 608 views
  • 1 like
  • 2 in conversation