I'm looking for a quick way to check the next five values in panel
dataset.
Data are
. tsset
panel variable: id (strongly balanced)
time variable: year, 1888 to 2005, but with gaps
This works:
bysort id (year): gen for5=max(mem, mem[_n+1], mem[_n+2], mem[_n+3],
mem[_n+4], mem[_n+5])
but involves the messy indexing. I would like something like this:
. egen for5=rowmax(F(1/5).mem_data)
time-series operators not allowed
r(101);
Thanks!
Caleb
[email protected]
University of Oregon Sociology
*
* 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/