This code below creat a uniform (0,1), how can I modify to creat uniform (0.2, 1)
data t;
do i = 1 to 50;
a=uniform(0);
output;
end;
run;
Did you try it? I think the range will be between .2 and 1
Couldn't you achieve that with: a=.8*uniform(0)+.2;
This wont work, it will give values that are more than 1
Did you try it? I think the range will be between .2 and 1
Yes it works, Thanks
For the general case, see How to generate random numbers in SAS - The DO Loop
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.
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.