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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.