Displaying 1 result from an estimated 1 matches for "bl12".
Did you mean:
bb12
2007 Jun 04
1
Help with conditional lagging of data
...2000 100
AB12 2001 120
AB12 2002 140
AB12 2003 80
BL14 2000 180
BL14 2001 150
CR93 2000 45
CR93 2001 49
CR93 2002 56
CR93 2003 67
Expected output from this data
ID Year Xlag
AB12 2000 .
AB12 2001 20
AB12 2002 20
AB12 2003 -60
BL12 2000 .
BL14 2001 -30
CR93 2000 .
CR93 2001 5
CR93 2002 7
CR93 2003 9
Can somebody please help me with how to implement this in R. Thanks.
Sincerely
Anup
---------------------------------
Looking for a deal? Find great prices on flights and hotels with Y...