From: vncntj on
I'm trying to randomize values between .20 and .25. I'm not sure how
to manipulate that with:

ranuni(123)

thanks,
From: Patrick on
This gives you 100 random numbers in the desired range.

data RandomNums(drop=i);
do while(i<100);
RandomNumber=ranuni(123);
if RandomNumber>=0.2 and RandomNumber<=0.25 then
do;
output;
i+1;
end;
end;
run;
From: Richard A. DeVenezia on
On Mar 13, 11:55 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
> I'm trying to randomize values between .20 and .25.  I'm not sure how
> to manipulate that with:
>
> ranuni(123)
>
> thanks,

randomInRange = rangeBottom + (rangeTop-rangeBottom) * RANUNI(0);

Read help on RANUNI(seed) to understand how the seed argument is used.
RANUNI is one of a family of RAN* call routines for random number
generation (RNG). The other routines produce output that conform to
various distributions such as Normal or Poisson.

In your specific case:

x = 0.20 + 0.05 * ranuni(0);

--
Richard A. DeVenezia
http://www.devenezia.com
From: vncntj on
On Mar 14, 8:15 am, "Richard A. DeVenezia" <rdevene...(a)gmail.com>
wrote:
> On Mar 13, 11:55 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
>
> > I'm trying to randomize values between .20 and .25.  I'm not sure how
> > to manipulate that with:
>
> > ranuni(123)
>
> > thanks,
>
> randomInRange = rangeBottom + (rangeTop-rangeBottom) * RANUNI(0);
>
> Read help on RANUNI(seed) to understand how the seed argument is used.
> RANUNI is one of a family of RAN* call routines for random number
> generation (RNG).  The other routines produce output that conform to
> various distributions such as Normal or Poisson.
>
> In your specific case:
>
>   x = 0.20 + 0.05 * ranuni(0);
>
> --
> Richard A. DeVeneziahttp://www.devenezia.com


Mr. DeVenezia, thanks a lot. That worked perfectly!!
From: Patrick on
Oops! Yes, of course! That's how it's done best.
Thanks, Richard