I am using ExecuComp/Compustat data that look something like this:
gvkey|Year |Ticker |
-------|-----|--------|
001111| 2006| abc |
001111| 2007| abc |
001111| 2008| abc |
001111| 2009| abc |
001112| 2006| www |
001112| 2009| www |
001113| 2008| ttt |
001114| 2010| vvv |
How can I only keep firms that have any 4 consecutive years of observations?
I tried to read the FAQ and related forum questions, but I cannot seem to get my head around it.