[英]sas - how to match current row with previous and then assign a value in the another column
[英]how to get value of previous row in sas
我沒有遵循所有的邏輯,但是分組滯后可以像這樣處理。
data have;
input Lan A B C;
datalines;
123 100 5 95
123 95 6 89
123 89 7 82
123 82 8 74
456 500 2 498
456 498 3 495
456 495 4 491
456 491 5 486
789 600 6 594
789 594 7 587
789 587 8 579
;
data want;
set have;
by Lan;
lagC = ifn(first.Lan, ., lag(C));
run;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.