Creat a uniform (0.2, 1)

Accepted Solution Solved
Reply
Super Contributor
Posts: 303
Accepted Solution

Creat a uniform (0.2, 1)

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;


Accepted Solutions
Solution
‎05-24-2014 04:33 PM
PROC Star
Posts: 7,492

Re: Creat a uniform (0.2, 1)

Posted in reply to desireatem

Did you try it?  I think the range will be between .2 and 1

View solution in original post


All Replies
PROC Star
Posts: 7,492

Re: Creat a uniform (0.2, 1)

Posted in reply to desireatem

Couldn't you achieve that with: a=.8*uniform(0)+.2;

Super Contributor
Posts: 303

Re: Creat a uniform (0.2, 1)

This wont work, it will give values that are more than 1

Solution
‎05-24-2014 04:33 PM
PROC Star
Posts: 7,492

Re: Creat a uniform (0.2, 1)

Posted in reply to desireatem

Did you try it?  I think the range will be between .2 and 1

Super Contributor
Posts: 303

Re: Creat a uniform (0.2, 1)

Yes it works, Thanks

SAS Super FREQ
Posts: 3,755

Re: Creat a uniform (0.2, 1)

Posted in reply to desireatem
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 264 views
  • 0 likes
  • 3 in conversation