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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.