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

Re: st: creating lag variable


From   Richard Williams <[email protected]>
To   [email protected], [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index