Friday, 7 October 2011

Cummalative Frequency


data dm;
input pid visit dose;
cards;
101 1 5
102 1 10
103 1 15
101 2 5
102 2 10
103 2 15
101 3 5
102 3 10
103 3 15
;
proc sort data=dm out=dm1;
 by pid;
 run;

 data dm5;
 set dm1;
 by pid;
 if first.pid then cdose=0;
 cdose+dose;
run;
 proc print data=dm5 ;
 run;

No comments:

Post a Comment