Does anyone know how can I create lags when I am using a long format xt
dataset eg:
Id year var1 var2 ......
12 1
12 2
12 3
12 4
13 1
13 2
13 3
13 4
If I use the command generate xlag= x[_n-1] then this will only create one
missing value at the first observation for the individual with the personal
identification mumber 12 and none for the rest- hence -this mixes up
different individuals' observations.
Can anyone help?
George
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/