Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: XT LAGS


From   gmc107@york.ac.uk
To   <statalist@hsphsun2.harvard.edu>, <n.j.cox@durham.ac.uk>
Subject   st: XT LAGS
Date   Mon, 20 Jun 2005 01:22:25 +0100

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index