From: vncntj on 13 Mar 2010 22:55 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 14 Mar 2010 07:03 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 14 Mar 2010 08:15 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 14 Mar 2010 13:49 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 17 Mar 2010 08:11 Oops! Yes, of course! That's how it's done best. Thanks, Richard
|
Pages: 1 Prev: SAS 9.2 on windows 7 Next: Plot time series over an interval |