Date: Wed, 2 Aug 2000 15:57:24 +0200
Reply-To: Claus Gotfred Rasmussen <CGR@ACCEPTCARD.DK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Claus Gotfred Rasmussen <CGR@ACCEPTCARD.DK>
Subject: Re: how to get cumulative freq out of a proc freq
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I am sorry that I didn't explain everything in the first post - I have this
problem:
In my proc freq I use several variables in a BY statement, and I want the
cum freq's within these BY groups. My output window looks like this:
*************sas output**************
niche0=ung
The FREQ Procedure
Cumulative Cumulative
score10 Frequency Percent Frequency Percent
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
10 1 0.02 1 0.02
20 5 0.08 6 0.10
30 14 0.23 20 0.33
.
.
.
niche0=gl
The FREQ Procedure
Cumulative Cumulative
score10 Frequency Percent Frequency Percent
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
20 3 0.01 3 0.01
30 12 0.05 15 0.07
40 12 0.05 27 0.12
.
.
.
*******************
produced by this code:
proc freq ;
table score10;
by niche0;
run;
- hope this explains more
-----Original Message-----
From: Fehd, Ronald J. [mailto:rjf2@CDC.GOV]
Sent: Wednesday, August 02, 2000 3:31 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: how to get cumulative freq out of a proc freq
> From: Claus Gotfred Rasmussen [mailto:CGR@ACCEPTCARD.DK]
> When one creates a one way table with proc freq, the
> cumulative frequencies
> are displayed on the screen - can these be included in the
> output data set
> in any way?
You will have to have a data step where you add the cumulative variables.
proc FREQ ...;
tables Var / out = FREQ;
data FREQ;
retain CumCount CumPercent 0;
set FREQ;
CumCount + Count;
CumPercent + Percent;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
---> cheerful provider of UNTESTED SAS code!*! <---