LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 27 Apr 2000 21:17:12 -0400
Reply-To:     Jay Weedon <jweedon@EARTHLINK.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jay Weedon <jweedon@EARTHLINK.NET>
Organization: http://extra.newsguy.com
Subject:      Re: Random sample
Content-Type: text/plain; charset=us-ascii

The indexing I specified in the first data step does the sorting implicitly, so no prob there.

And if the various random number generator functions are all equally "random" it won't make any diff. what prob. distribution I use!

Jay.

On Thu, 27 Apr 2000 16:13:16 -0400, Frank Mwaniki/PH/Novartis wrote:

>You need to sort the new dataset by the random number before you extract the >random sample. Also note that "ranuni" a one of a number of functions you can >use to generate a random indicator. > >HTH Frank > > > > >Jay Weedon <jweedon@EARTHLINK.NET> on 04/27/2000 02:46:13 PM > >Please respond to Jay Weedon <jweedon@EARTHLINK.NET> > >To: SAS-L@LISTSERV.UGA.EDU >cc: (bcc: Frank Mwaniki/PH/Novartis) >Subject: Re: Random sample > > > > >Dear SJ, > >data scratch (index=(randno)); > set old; > randno=ranuni(0); >run; > >data new; > set scratch (obs=x); > by randno; drop randno; >run; > >where "x" is the (integer) number of records desired. Depending on >what you need to do, you may need to resort the output data set. > >Jay Weedon. > >On Thu, 27 Apr 2000 17:57:34 +0100, "Sunny Jim" <jez@jbassett.co.uk> >wrote: > >>Does anyone have any decent code to pick x random records from a dataset. I >>just cannot find that program I wrote. >> >>Thanks >> >>Sunny Jim >> > > > > > >


Back to: Top of message | Previous page | Main SAS-L page