Dear all,
I am using a heavily unbalanced dataset and want to generate the yearly lag term of X1.
For example:
ID Year X1 L.X1(should be like this)
1 2001 1 0
1 2003 3 2
1 2005 5 4
2 2000 0 .
2 2002 2 1
2 2004 4 3
3 2003 3 2
3 2004 4 3
3 2005 5 4
As xtset is impossible for my case, how do I generate L.X?
I am using a heavily unbalanced dataset and want to generate the yearly lag term of X1.
For example:
ID Year X1 L.X1(should be like this)
1 2001 1 0
1 2003 3 2
1 2005 5 4
2 2000 0 .
2 2002 2 1
2 2004 4 3
3 2003 3 2
3 2004 4 3
3 2005 5 4
As xtset is impossible for my case, how do I generate L.X?
Comment