Date: Tue, 14 Jan 1997 23:13:16 -0500
Reply-To: Luming Chen <lumingch@mail.bcpl.lib.md.us>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Luming Chen <lumingch@MAIL.BCPL.LIB.MD.US>
Subject: Attrition
Content-Type: TEXT/PLAIN; charset=US-ASCII
Is anyone who has calculate attrition in finance industry in SAS? Please
help!
I have been trying to do it.
as I was told that attrition=1-(one month's accounts/the earlier month's
accounts).
I was asked to produce a attrition report by vintage (year) and month of
book (how many months the accounts booked). I need to have each sum of
month from 1 to 18 so that I can calculate attrition.
what I did was:
data a;
set b(keep=openyear mob);
if 1<=mob<=18;
retain acct 1;
proc summary;
class mob openyear;
var acct;
output out=result sum=acctsum;
data two; set a;
array tot [18];
array att [18];
if 1<=mob<=18 then do;
tot [mob]=acctsum;
att [mob]=1-(tot [mom] / tot [mob-1]);
end;
I didn't get the attrition as all the results are blank '.'
even I didn' use the array and just repeated coding the attrtion, I also
could get the result. If I just print the result of the first array, they
look like:
mob tot1 tot2 tot3.....................tot18
1 1992 4545
1 1993 4546
1 1994 0982
1 1995 9834
1 1996 8712
2 1992 3490
2 1993 9084
2 1994 8934
2 1995 1289
2 1996 4587
3 1992 0993
3 1993 7865
3 1994 1234
3 1995 7645
3 1996 8900
. ..
. ..
.
( the #s are not real. I just use them as demonstration)
TIA,
Luming