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

st: RE: creating lag variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: creating lag variable
Date   Wed, 9 Jun 2004 11:31:17 +0100

In addition to other suggestions, this 
raises the question of how you are 
searching. 

A literal 

. search lag function 

does point to several sources on information. 
However, as Kit Baum pointed out if your 
data are time series then using -tsset- is 
preferable to subscripting (e.g. using [_n-1]). 

Nick 
n.j.cox@durham.ac.uk 

sarah smith
 
> I am trying to create a lag variable
> 
> y(t) = x(t-1)
> 
> I searched for a lag function but could not find. Any suggestions?

*
*   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