Posted By


webonomic on 03/31/08

Tagged


Statistics


Viewed 117 times
Favorited by 0 user(s)

Cummulative Totals


/ Published in: SAS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. data one;
  2. input pulldate MMDDYY10.
  3. tsippT 12-14
  4. tsippC 15-18
  5. count 20;
  6. format pulldate date7.;
  7. cards;
  8. 08/04/2006 34 24 1
  9. 09/25/2006 343 200 2
  10. 10/20/2006 678 398 3
  11. 11/03/2006 713 406 4
  12. 02/07/2007 857 451 5
  13. ;
  14. run;
  15.  
  16. proc sort data=one;
  17. by pulldate;
  18. run;
  19.  
  20. data two;
  21. set one;
  22. by pulldate;
  23. if first.count then sumT=0;
  24. sumT+tsippT;
  25. if last.pulldate;
  26. run;
  27.  
  28. proc print data=two;
  29. run;

URL: http://jaredprins.squarespace.com/blog/2008/3/31/cumulative-totals.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.