Date: Mon, 30 Oct 2000 12:06:35 -0800
Reply-To: "Smith, Curtis, Mr, DCAA" <Curtis.Smith@DCAA.MIL>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Smith, Curtis, Mr, DCAA" <Curtis.Smith@DCAA.MIL>
Subject: Re: Please Help Me With Random Sample
Content-Type: text/plain; charset="iso-8859-1"
%LET SIZE=380;
%LET SEED=0;
DATA RANDOM;
RETAIN K &SIZE N;
IF _N_=1 THEN N=TOTAL;
SET UNIVERSE NOBS=TOTAL;
IF RANUNI(&SEED)<=K/N THEN
DO;
OUTPUT;
K=K-1;
END;
N=N-1;
IF K=0 THEN STOP;
RUN;
ods html file="C:\RANDOM.HTML" STYLE=D3D;
PROC REPORT DATA=RANDOM nowindows headskip missing
style(report)=[cellspacing=2 borderwidth=2]
style(header)=[foreground=yellow font_face=lucida
font_style=italic font_size=3]
style(column)=[foreground=/*moderate*/ black font_face=helvetica
font_size=3]
style(lines)=[foreground=white background=black font_face=lucida
font_style=italic font_weight=bold font_size=2 just=l]
style(summary)=[foreground=cx3e3d73 background=cxaeadd9
font_face=helvetica font_weight=bold font_size=3 just=r]
;
COL VAR1 VAR2 VAR3;
DEFINE VAR1 /DISPLAY;
DEFINE VAR2 /DISPLAY;
DEFINE VAR3 /DISPLAY;
TITLE1 justify=center color=blue font="Century Schoolbook" height=12 pt
"SAMPLE SELECTION";
RUN;
ods html close;
-----Original Message-----
From: Brian Vuong [mailto:brian-vuong@USA.NET]
Sent: Monday, October 30, 2000 11:34 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Please Help Me With Random Sample
Hi Everyone,
I have a data set with 10,000 observations. I need to pick 380 observations
from the data set randomly. Please show me how to do it. I really
appreciate your help.
Thanks,
Brian Vuong
|