On Jun 9, 2004, at 7:33 AM, Richard wrote:
gen y = x[_n-1]
Bad idea; that says that y is the previous value of x, which may or may
not be associated with the previous time unit. Better to tsset the data
(establish a time series calendar) and then
gen y = L.x
which will ensure that if there are gaps in the time series they are
respected. This can save you a LOT of time in debugging situations
where there may be a discontinuity on the time axis.
Kit
*
* 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/