作者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