proc sort data=ss out=tt;
by d3 c1;
run;
proc sql;
create table new as
select d3,
a1,
count(a1 ) as ct
from tt
group by d3,a1 ;
quit;
请教各位,上面的可以实现就一个变量d3分组的变量a1的计数,如果需要对d3,d4,d5分别分组,然后对a1-a4,b1-b3分别计数,
比如,d3取1,2,3,4,a1取1,2,3,4,我要累计(d3,a1)=(1,1),(1,2).....等等的数目.
谢谢 |