Date: Mon, 12 Feb 2007 13:10:56 -0500
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: Sampling in SAS
On Mon, 12 Feb 2007 07:41:25 -0800, Syb it <sas_datalover@YAHOO.COM> wrote:
>Data_null:
>
> Questions:
>
> 1) Can this be done in Proc SQL?
How about this?
reset outobs=100;
create table SQL_Hundred as
select *
from aFewThousand
order by ranuni(205872001)
;
reset outobs=max;
> and in your code below:
> 2) do I = 1 to 2e3; Is 2e3 the maximum number of records in my original data?
> 3) and that seed number? What exactly is it?
>
> 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.
|