Date: Tue, 10 Aug 2004 16:06:24 -0700
Reply-To: Dale McLerran <stringplayer_2@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <stringplayer_2@YAHOO.COM>
Subject: Re: QUINTILES: Help needed
In-Reply-To: <e2f33a06.0408101117.6f3ee1fe@posting.google.com>
Content-Type: text/plain; charset=us-ascii
Alex,
It is not clear whether you want to identify the values which
cut the data into quintiles or if you want to assign the data to
quintiles. The suggestion to use PROC RANK with the GROUPS=5
option would assign the data to quintiles. However, if you
want to identify the values which cut the data into quintiles,
then you could use something like the following:
PROC UNIVARIATE noprint DATA=PRFOLATE;
VAR E_LYC E_MET VAR2 VAR3 VAR4;
OUTPUT OUT=CUT1 PCTLPTS=20 pctlname=_
pctlpre=E_LYC E_MET VAR2 VAR3 VAR4;
OUTPUT OUT=CUT2 PCTLPTS=40 pctlname=_
pctlpre=E_LYC E_MET VAR2 VAR3 VAR4;
OUTPUT OUT=CUT3 PCTLPTS=60 pctlname=_
pctlpre=E_LYC E_MET VAR2 VAR3 VAR4;
OUTPUT OUT=CUT4 PCTLPTS=80 pctlname=_
pctlpre=E_LYC E_MET VAR2 VAR3 VAR4;
TITLE 'QUINTILES FOR CREATION OF CATEGORICAL VARIABLES';
RUN;
data cut;
retain pctile;
set cut1(in=a)
cut2(in=b)
cut3(in=c)
cut4(in=d);
pctile = 20*a + 40*b + 60*c + 80*d;
run;
proc print data=CUT;run;
Dale
--- Alex <apavluck@GMAIL.COM> wrote:
> Hello. I am trying to calculate quintiles for multiple continuous
> variables. I have come up with the below code but I don't like the
> output (1 long line). Is there a better way to do this OR is there a
> way to drop a line after each run?
>
> Thanks, Alex
>
>
>
> *****************CODE******************************;
>
> PROC UNIVARIATE noprint DATA=PRFOLATE;
> VAR E_LYC E_MET VAR2 VAR3 VAR4;
> OUTPUT OUT=CUT PCTLPTS=20 40 60 80
> pctlpre=E_LYC_ E_MET_ VAR2_ VAR3_ VAR4_;
> TITLE 'QUINTILES FOR CREATION OF CATEGORICAL VARIABLES';
> RUN; proc print data=CUT;run;
>
=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@fhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail