I have panel data containing historical firm´s earnings from different quarters. Quarters are unbalanced. For example, both a firm with quarterly data between 1985 & 1996 and a firm that only has data between 2000 & 2008 will be included in the analysis. However, I want to only assess firms that have reported earnings (either positive or negative) for at least 12 quarters in a row. Suppose that I have one company with data between 2000-2004 and 2005-2006, then I want to drop all the observations of the 2005-2006 period. How to do so?
Also, Let’s say that from this company, I also have data from 1980-1988 to 1996-2002. Is there a way to tell Stata to treat these different periods as three separate panels?
My data:

Thanks!
Also, Let’s say that from this company, I also have data from 1980-1988 to 1996-2002. Is there a way to tell Stata to treat these different periods as three separate panels?
My data:
- Gvkey (firm identifier)
- Qdate (quarterly date e.g. 1986q3)
- NIQ (Quarterly figure net income/loss)
Thanks!
Comment