请问有一个变量,
X=1, 2 ,2.3我们知道
Lag(X)=* ,1,2;
有没有函数使得
Y=2,2.3,*?
多谢
楼主: mcsyky
|
2257
2
[求助]Sas序列求助 |
讲师 10%
-
|
回帖推荐*1. use id+1 to create a observation rank number;
*2. create data b from second observation of your data a; use firstobs=2; but the observation number is one step up;
*3. merge your original data 'a' and new data 'b' together;
*******************************************************************;
data a;
id+1;
input x @@;
lagx=lag(x);
cards;
1 2 2.3 55 0.7 100 11
;
run;
proc print dat ...
本帖被以下文库推荐
| ||
京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明 免责及隐私声明