[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: -count- continuous data in panels
I have a balanced panel dataset; for example 1000 cross sections, from 1990-1999
for each cross sections. Now, if I wish to count the observations in each panel
that are not missing values, this can be done via -by ... : egen count [if
However, in my case I wish to count the maximum number of continuous yearly
observations that are not missing values for a specified variable.
To make myself more clear, for example, if the variable X1 has for the AA cross
section values only for 1991-1992, 1995 and 1996-1999, then the maximum number
of continuous observations is 4 (1996-1999).
Another example, if the variable X1 has for the BB cross section values only
from 1993-1998, then the maximum number of continuous observations is 6.
Any advice is very welcome, many thanks in advance
This mail sent through http://webmail.bangor.ac.uk
* For searches and help try: