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

st: RE: RE: Re: maximum 'run' of observations in panel data


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Re: maximum 'run' of observations in panel data
Date   Tue, 13 Aug 2002 09:12:50 +0100

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 
n.j.cox@durham.ac.uk 
*
*   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