suppose to have the following dataset:
data dataset;
input week_number Var1 Var2;
cards;
1 55 98
2 34 34
3 21 0
4 76 12
5 98 0
.. ... ..
52 21 43
;run;
what is the best way to calculate and add the following: lag of -1 week; lag of +1 week; lag of -2 weeks; lag of +2 weeks to the original dataset?
Thank you in advance