Date: Mon, 13 Sep 2010 19:50:33 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: how to generate 1 to 100k random numbers without zeros?
John,
Nice to see you back again!
This thread actually (as I recall at least) started on comp.soft-sys.sas.
The OP, at it turned out, wanted random numbers between 1 and 100,000,
with replacement.
As datanull pointed out, in that thread, without replacment proc plan
provided a much easier alternative. Any of the other solutions, using
only the ranuni function, would result in duplication.
When one is limiting the selection of fractions, by using whatever
function, either 0 or duplication is of course possible.
Art
-------
On Tue, 14 Sep 2010 00:35:54 +0100, John Whittington
<John.W@MEDISCIENCE.CO.UK> wrote:
>At 17:59 13/09/2010 -0400, Viel, Kevin wrote (in part):
>>According to the documentation:
>>"The RANUNI function returns a number that is generated from the uniform
>>distribution on the interval (0,1)"
>>Indeed, (0,1) does not include 0 and 1. However, this is inconsistent
>>with the uniform distribution as I know it, which includes its endpoints,
>>so I wonder if it should not be [0,1].
>
>An interesting, but extremely academic, question. As far as
practicalities
>are concerned, is it not true that when (as in the real world) figures are
>expressed to any finite degree of precision, (0.1) _does_ include the
>endpoints?
>
>Kind Regards,
>
>
>John
>
>----------------------------------------------------------------
>Dr John Whittington, Voice: +44 (0) 1296 730225
>Mediscience Services Fax: +44 (0) 1296 738893
>Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
>Buckingham MK18 4EL, UK
>----------------------------------------------------------------
|