Kit Baum communicated the thoughts of Vince Wiggins
> . by id: gen run = cond(l.run==., 1, l.run+1)
> . egen maxrun = max(run), by(id)
and Frank de Libero asked
> Looks elegant but what was the question? :)
This refers to a thread started by Guillermo Cruces
on Friday with contributions by Dick Campbell,
Kit Baum and myself.
The question is as indicated in the title: what
is the longest run of consecutive observations (i.e. without
gaps) in panel data?
Nick
[email protected]
*
* 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/