BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi everyone,

I have a question. Is possible to generate a random numbers from a normal and T distribution with a given minimum and maximum possible values?

For example, given the following parameters: a minimum possible value of -15, a maximum of 40, a mean of 9.5, and a variance of 50...

What is a correct SAS code so I can obtain a pseudo-population with these parameters using both the RANNOR and the RAND functions?

In other words how can I obtain a pseudo-population whose parameters can be similar to the "real population" under study using RANNOR and RAND functions?

Thanks in advance for your help.
3 REPLIES 3
art297
Opal | Level 21
Caramel,

According to the following SUGI 31 paper, a macro exists that does what you are looking to accomplish:

http://www2.sas.com/proceedings/sugi31/198-31.pdf

However, I've been unable to obtain a copy of that macro. If anyone has it, I'd appreciate knowing how to find it.

Art
Doc_Duke
Rhodochrosite | Level 12
Art,

It looks like the author is still at Sanofi-Aventis. Have you tried to e-mail or call her directly.

Someone else was looking for the macro on SAS-L a couple of years ago, but had no follow-up.

Doc
art297
Opal | Level 21
Doc,

Yes, I both saw that post and emailed the paper's author the same day as I posted my response to the current thread. If she resonds, I'll post the answer here.

Art

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2920 views
  • 0 likes
  • 3 in conversation