Date: Mon, 12 Feb 2007 10:55:35 -0500
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_;" <datanull@GMAIL.COM>
Subject: Re: Sampling in SAS
In-Reply-To: <804930.21435.qm@web62215.mail.re1.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 2/12/07, Syb it <sas_datalover@yahoo.com> wrote:
> Data_null:
>
> Questions:
>
> 1) Can this be done in Proc SQL?
I think so but I don't recommend it, over SURVEYSELECT Others can
advise in that regard.
> and in your code below:
> 2) do I = 1 to 2e3; Is 2e3 the maximum number of records in my original
> data?
2e3 is 2000. I was just making same sample data. You will not use this step.
> 3) and that seed number? What exactly is it?
Random number generators use a seed. You put in a seed and get out a
pseudo random number and the seed for the next call. You can let SAS
choose the seed but you will get a different answer each time you run
the program May or may not be what you want.
>
> Thanks,
>
>
> "data _null_;" <datanull@gmail.com> wrote:
> SURVEYSELECT is a good choice if you have SAS/STAT software.
>
> data work.aFewThousand;
> do I = 1 to 2e3;
> output;
> end;
> run;
> proc surveyselect
> seed = 205872001 /* use a different number */
> method = srs /* Simple Random Sampling */
> data = work.afewthousand
> out = work.OneHundred
> n = 100
> ;
> run;
> proc print;
> run;
>
> On 2/12/07, Syb it wrote:
> > How does one generate a random sample in SAS? LEts say you had a couple
> thousand observations but one only wanted 100 randomly selected from the
> bigger database? Any clues?
> >
> >
> > ---------------------------------
> > 8:00? 8:25? 8:40? Find a flick in no time
> > with theYahoo! Search movie showtime shortcut.
> >
>
>
>
> ________________________________
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
>
>
|