Creat a uniform (0.2, 1)

Accepted Solution Solved
Reply
Super Contributor
Posts: 297
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,363

Re: Creat a uniform (0.2, 1)

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,363

Re: Creat a uniform (0.2, 1)

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

Super Contributor
Posts: 297

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,363

Re: Creat a uniform (0.2, 1)

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

Super Contributor
Posts: 297

Re: Creat a uniform (0.2, 1)

Yes it works, Thanks

SAS Super FREQ
Posts: 3,476

Re: Creat a uniform (0.2, 1)

☑ This topic is SOLVED.

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

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