turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- How to Generating Random Numbers with Specific Dis...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-07-2011 02:36 AM

Hello ^^

I'm new for this program, SAS. But for some reason I have to work with this, I have 2 big questions (seems big problem to me too) here ...

1. Is it possible to generate random numbers from a specific distribution (such as a normal or something els)

2. How can I generate set of random numbers with specific range such as 1 - 9.

Thank you for you comment and sorry about my broken english.

I'm new for this program, SAS. But for some reason I have to work with this, I have 2 big questions (seems big problem to me too) here ...

1. Is it possible to generate random numbers from a specific distribution (such as a normal or something els)

2. How can I generate set of random numbers with specific range such as 1 - 9.

Thank you for you comment and sorry about my broken english.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to s_chanon

02-07-2011 03:52 AM

what would you imagine?

a RAND function, to provide a random number from the distribution you define?

Read the online-doc here

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm

at the reference documentation for* *

RAND Function

Generates random numbers from a distribution that you specify.

You'll find much useful information in the http://support.sas.com website

2

to generate a uniformly distributed random number between 0 and 1

R01 = rand( 'uniform') ;

or, for a uniformly random integer between 0 and 9

R09 = int( 10 * rand( 'uniform' ) ) ;

a RAND function, to provide a random number from the distribution you define?

Read the online-doc here

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm

at the reference documentation for

RAND Function

Generates random numbers from a distribution that you specify.

You'll find much useful information in the http://support.sas.com website

2

to generate a uniformly distributed random number between 0 and 1

R01 = rand( 'uniform') ;

or, for a uniformly random integer between 0 and 9

R09 = int( 10 * rand( 'uniform' ) ) ;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Peter_C

02-24-2011 04:44 AM

Thanks so much, this is very helpful ^^

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to s_chanon

10-12-2011 09:10 AM

See also my blog post, "How to generate random numbers in SAS"