Date: Thu, 10 Apr 2008 14:25:26 -0400 Muthia Kachirayan "SAS(r) Discussion" Muthia Kachirayan Re: Modeling Cumulative Percentages To: jeffrey.m.allard@gmail.com text/plain; charset=ISO-8859-1

On Thu, Apr 10, 2008 at 8:11 AM, <jeffrey.m.allard@gmail.com> wrote:

> Hello All- > > Can anyone point me in a direction for a good way to model a > cumulative (percentage complete)curve? Specifically, I am able to > observe from point in time zero, the number of events by day (these > are responses to a marketing promotion). I observe the data for say 2 > years: > Day 1: 380 > Day 2: 420 > .. > Day 60: 25 > .. > Day 720: 5 > > and I want to be able to model this as a 'percentage complete' bounded > by 0 and 100% over time, extending out beyond my observed time period > (there will be small counts out there but I know responses still occur > even after 2 years). I need the model to predict percentage and not > actual counts. > > Thanks! >

I think that you have a frequency distribution and you want to compute cumulative frequency in percents for the first 720 observations. This means that the cumulative frequency is found for the first 720 observations and cumulative_total and output the percent of observations by dividing the cumulated frequency by cumulative_total. All observations beyond 720 are to be ignored. If this is correct, then you can do it this way.

data have; do day = 1 to 1000; x = round((ranuni(123) * 999),1); output; end; run; %let n = 720; data need; if _n_ = 1 then do; do i = 1 to &n; set have ; tot ++ x; end; end; do i = 1 to &n; set have; cum_x ++ x; cum_p = cum_x / tot * 100; output; end; stop; drop i tot cum_x; run; proc print data = need; run;

Muthia Kachirayan

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