I am new to R and moved from SAS.
I have Time Series Cross Sectional Data with 24 months for each ID. snapshot like
ID Time Var
1 201201 2.5
1 201202 3.2
1 201203 4.1
1 201204 3.2
1 201205 4.1
2 201201 1.8
2 201202 5.6
2 201203 4.5
2 201204 9.2
2 201205 8.1
Now, I have to create Var1, Var2, var3, var4 and var5 with 5 lags where var1 will be lagged with 1, var 2 will have lag of 2 and so and so for.. 'Slide' function for DataCombine library can do this job but I can't install R 2.15.3 or above and Slide is for >=2.15.3.
Could you please help me in solving this problem? in SAS, I could have done this using Proc Panel but I don't know how to do it in R.