我想对一个数据集作如下处理:给满足条件的某些观测前后一定范围的观测作出标记。
这里我用了IML处理,主要代码如下:
proc iml;
use b;
read all var _all_ into x;
do i=1 to nrow(x);
if x[i,3] = 1
then
do while(i-50<=j<=i+50);
x[j,6] = 1;
end;
end;
create new from x;
append from x;
quit;
但是日志却显示有错误:
ERROR: (execution) Matrix has not been set to a value.
operation : <= at line 336 column 18
operands : _TEM1003, J
_TEM1003 1 row 1 col (numeric)
140
J 0 row 0 col (type ?, size 0)
statement : DO at line 336 column 5
ERROR: Error evaluating DO WHILE expression; DO loop exited.
请问这是为什么?应该如何修改???
谢谢。