作者anovachen (囧)
看板Statistics
标题Re: [问题] 如何切割重复资料
时间Fri Aug 16 23:48:16 2013
data test;
input id sex score;
cards;
1 1 60
2 1 78
3 2 77
1 1 70
1 1 66
3 2 59
;
run;
proc sort data=test out=test;
by id sex;
run;
data test1;
set test;
by id sex;
if first.id=1 and last.id=1 and first.sex=1 and last.sex=1 then output;
run;
data test2;
set test;
by id sex;
if not (first.id=1 and last.id=1 and first.sex=1 and last.sex=1) then output;
run;
※ 引述《leo20090401 (花花超人)》之铭言:
: 简言之直接举例
: input id sex score
: cards;
: 1 1 60
: 2 1 78
: 3 2 77
: 1 1 70
: 1 1 66
: 3 2 59
: ;run;
: 想切成两块1.有重复2无重复共两个档
: 有重复资料集
: 1 1 60
: 1 1 70
: 1 1 66
: 3 2 77
: 3 2 59
: 无重复资料集
: 2 1 78
: 感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 111.255.243.39