Date: Mon, 21 Jan 2008 11:39:00 -0600
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: Cummulative sum other subgroup
In-Reply-To: <facc32fc-9e16-41cf-9d41-18a078c74616@v46g2000hsv.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
PROC FREQ can be use for that.
proc freq;
by an mo;
tables de / noprint out=csum outcum;
weight ct;
run;
proc print;
run;
On Jan 21, 2008 10:57 AM, <djassy@gmail.com> wrote:
> Is there someone to help me?
> I would like to calculate cc as cumulative sum of ct, group by an, mo,
> de
>
>
> an mo de cc ct
> 1 1 1 5 5
> 1 1 2 7 12
> 1 1 3 6 18
> 1 2 1 8 8
> 1 2 2 3 11
> 2 1 1 9 9
> 2 1 2 6 15
> 2 2 1 4 4
>
> data test ;
> input an mo de ct;
> datalines;
> 1 1 1 5
> 1 1 2 7
> 1 1 3 6
> 1 2 1 8
> 1 2 2 3
> 2 1 1 9
> 2 1 2 6
> 2 2 1 4
> ;
> proc print;
> run;
>
|