Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: searching in a list.


From   "Ashim Kapoor" <ashimkapoor@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: searching in a list.
Date   Thu, 18 Sep 2008 10:46:14 +0530

Hello everyone,

I have a query.  I want to lag a variable but by _n-1.

I want to say : sort  state year

now I want something like  : by year state : replace incumbent =
winner[_n-1] but here the winner[_n-1] should be the winner in the
same state but prev year , ie. it should be from the  PREVIOUS BLOCK
of state year.

Any ideas anyone ?

Thank you,
Ashim.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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