作者h0h1 ()
看板Statistics
标题Re: [问题] 请问sas资料加总问题
时间Wed Jun 3 21:21:22 2009
proc sql;
create table test as
select age, sum(live) from a
group by age;
quit;
※ 引述《wlsherica (Mon_tresor)》之铭言:
: 刚刚尝试写了一下, 有错请指正~~
: 如果有更快的方法, 请告诉我吧 ^^ 谢谢
: data a;
: input age live;
: cards;
: 0 0.2
: 1 0.3
: 1 0.1
: 1 0.8
: 2 0.45
: 2 0.7
: 4 0.9
: 4 0.1
: run;
: proc sort data=a;
: by age;
: data b;
: set a;
: by age;
: if first.age=1 then c=.;
: c+live;
: if last.age=1;
: proc print;
: run;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.119.80.111
1F:→ algov:谢谢 06/03 22:30