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

Re: st: creating lag variable


From   Richard Williams <Richard.A.Williams.5@ND.edu>
To   statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu
Subject   Re: st: creating lag variable
Date   Tue, 08 Jun 2004 23:41:11 -0500

At 03:48 AM 6/9/2004 +0000, sarah smith wrote:
Dear Stata users;

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?
Thanks,
Sarah
gen y = x[_n-1]

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