Date: Mon, 20 Dec 2004 15:14:36 -0800
Reply-To: ezhou@SHAW.CA
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Eric Zhou <ezhou@SHAW.CA>
Organization: http://groups.google.com
Subject: Re: count number of transaction
Content-Type: text/plain; charset="iso-8859-1"
David L. Cassell wrote:
> eric <ezhou@SHAW.CA> wrote:
> > I have a dataset. How can I count the number of transaction which
> > contain both transid 1 and 4 and the number of tranaction which
> > contain only transid 1?
> >
> > For the following example, I would expect to have 5 counts for
> > transaction which contain both 1 and 4 and 5 counts for transaction
> > which only contain 1.
> >
> > thanks, Eric
> >
> >
> > data transaction;
> > input id transid price;
> > cards;
> > 100000 1 200
> > 100000 1 300
> > 100000 4 500
> > 100001 1 100
> > 100001 1 200
> > 100002 1 500
> > 100002 4 1000
> > 100003 1 50
> > 100003 1 60
> > 100003 1 70
> > 100003 1 80
> > ;
> > run;
> >
> > proc print data=transaction;
> > run;
>
> Okay, you have me completely mystified. By *my* count,
> you only have TWO ids containing both 1 and 4, and FOUR
> ids containing 1, and only four ids total.
>
> I think you need to either:
> [1] explain why your example yields the numbers it does; or
> [2] fix your example or your counts.
>
> Please write back (to the list, not to me personally) and
> explain a little better, so we can help you out.
>
> HTH,
> David
> --
> David Cassell, CSC
> Cassell.David@epa.gov
> Senior computing specialist
> mathematical statistician
|