作者BugEater (无庸)
看板Statistics
标题Re: [程式] SAS找last measurement
时间Sat Nov 9 04:35:28 2013
This may work.
********************************;
data test;
input x1-x7;
cards;
18 17 . 14 . 19 .
;;
run;
data test; set test;
array x[7] x1-x7;
do i=1 to 7;
if x[i] then do;
c1=x[i];
c2=i;
end;
end;
drop i;
run;
*****************************;
※ 引述《redcurrant (酒酿红醋栗)》之铭言:
: ------------------------------------------------------------------------
: [软体程式类别]:
: SAS
: [程式问题]:
: 资料处理
: [软体熟悉度]:
: 中(3个月到1年)
: [问题叙述]:
: 请问各位SAS高手 目前有一个充满missing value的data set要分析
: 每笔observation有1-7笔资料
: 我想要再产生两个column 一个是1-7中的"最後"一笔资料
: 然後另一个则是那笔资料是属於1-7的哪一个
: 如obs 1 2 3 4 5 6 7
: 1 18 17 - 14 - 19 -
: 则column 1 为 19
: column 2 为 6
: 请各位帮忙 谢谢~~
: -----------------------------------------------------------------------------
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 129.93.112.57
1F:推 redcurrant:太感激了 我就是想要阵列的方法 11/09 04:46
2F:→ BugEater:不客气:) 11/09 04:55