Date: Tue, 25 Aug 2009 09:06:20 -0700
Reply-To: olivesecret <olivesecret@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: olivesecret <olivesecret@GMAIL.COM>
Subject: Re: problems in data step
Content-Type: text/plain; charset=ISO-8859-1
On Aug 25, 11:43 am, billyk <sas...@gmail.com> wrote:
> On Aug 25, 11:09 am, olivesecret <olivesec...@gmail.com> wrote:
> > Hi I have a data set consisting of ID, response variable y and others.
> > There are several obs for each ID. How can I remove those IDs with
> > same values on y? In other words, if for one ID, all of obs have the
> > same value of y, then I remove all of obs belonging to this ID. Thanks
> > for any input!
> Try this....
> proc sort data=old; by id y; run;
> data new;
> set old;
> by id y;
> if first.y;
Your way will keep obs with unique y for each ID. This is different
from what I want. What I need is, remove those IDs which have the same
y in all of its obs.