LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 23 Aug 2001 17:52:49 -0700
Reply-To:   "Huang, Ya" <ya.huang@AGOURON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Huang, Ya" <ya.huang@AGOURON.COM>
Subject:   Re: proc rank equal-sized groups
Comments:   To: Tzachi Zach <zach@ssb.rochester.edu>
Content-Type:   multipart/alternative;

How about split your data into two subsets, and rank the one without the particular value first. And for the other one, assign a number 1-10 to x1 based on obs number, then concatenate them back to one data:

data a c; set original; if x ne *** then output a; else output c;

proc rank data=a out=b group=10; var x; ranks x1;

data c; set c; x1=mod(_n_,10);

data b; set b c;

Ya Huang

> -----Original Message----- > From: Tzachi Zach [mailto:zach@ssb.rochester.edu] > Sent: Thursday, August 23, 2001 4:37 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: proc rank equal-sized groups > > > Hi all, > > I have a data set of 20,000 oservations and i would like to > Group rank it > into 10 equal-sized groups (more or less). The problem is > that there is a > value that appears in about 7,000 observations. Proc rank > assigns all these > observations into one decile, resulting in an uneven distribution of > observations. I would like to spread these 7000 across a few > deciles, as > long as all the 10 deciles are equal-sized. > > The code i used was: > > proc rank data=a out=b groups=10; var x; ranks x1; > run; > > > Any ideas? > > Thanks, > Tzachi >


[text/html]


Back to: Top of message | Previous page | Main SAS-L page