Date: Tue, 10 Aug 2004 23:33:57 -0400
Reply-To: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject: Re: QUINTILES: Help needed
Another possibility is to use Alex's original code, which will place all of
the results in one observation. Then run PROC TRANSPOSE, followed by a DATA
step using the SCAN function to crack the _NAME_ values into their prefix
and suffix segments. That will be a little easier if the prefixes end with
a character which does not appear elsewhere.
I don't understand "drop a line after each run".
On Tue, 10 Aug 2004 16:06:24 -0700, Dale McLerran
<stringplayer_2@YAHOO.COM> wrote:
>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
|