又没人解释一下这段程序lag的用法啊
data test;
input x @@;
if mod(x,2)=0 then a=lag(x);
b=lag(x);
if mod(x,2)=0 then c=b;
label a='(WRONG) a' c='(RIGHT) c';
datalines;
1 2 3 4 5 6 7 8
;
proc print label data=test;
run;
Store Every Other Lagged Value 1 (WRONG) (RIGHT) Obs x a b c 1 1 . . . 2 2 . 1 1 3 3 . 2 . 4 4 2 3 3 5 5 . 4 . 6 6 4 5 5 7 7 . 6 . 8 8 6 7 7 为甚么用if 调用lag结果跟想象的不一样啊,希望高手解释一下lag的执行过程啊,多谢了