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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.