h****i 发帖数: 79 | 1 Does anyone know how to write a SAS code to get the increasement data from
culmulated data?
That is: suppose x is a SAS variable contains year_to_date counts for 12
months, how to get the value of y that is the increases of x from month to
month?
will thank with "Baozi" |
s******r 发帖数: 1524 | 2 Not sure I got you.
data b;set a;
y=x-lag(x);
run;
【在 h****i 的大作中提到】 : Does anyone know how to write a SAS code to get the increasement data from : culmulated data? : That is: suppose x is a SAS variable contains year_to_date counts for 12 : months, how to get the value of y that is the increases of x from month to : month? : will thank with "Baozi"
|
c*****t 发帖数: 1712 | |
h****i 发帖数: 79 | 4 That's good.
Thanks.
Will ask "Banzhu" to give you "Baozi". |
s*********r 发帖数: 909 | 5 In this case, y in the first obs will be a missing value.
【在 s******r 的大作中提到】 : Not sure I got you. : data b;set a; : y=x-lag(x); : run;
|
s******r 发帖数: 1524 | 6 If not missing, how you define one record without previous history?
【在 s*********r 的大作中提到】 : In this case, y in the first obs will be a missing value.
|
d*******o 发帖数: 493 | 7 data b;set a;
if _n_ = 1 then y = 0;
y=x-lag(x);
run; |
h****i 发帖数: 79 | 8 包子一个已奉上。
【在 s******r 的大作中提到】 : Not sure I got you. : data b;set a; : y=x-lag(x); : run;
|
p********a 发帖数: 5352 | 9 Baozi to whom?
【在 h****i 的大作中提到】 : That's good. : Thanks. : Will ask "Banzhu" to give you "Baozi".
|