Hello Guys,

My sample period is 1976 to 2016 (fyear in the attached dta file and gvkey is the firm id)
Based on the paper by Srivastava (2014, Why have measures of earnings quality changed over time?) I am trying to prepare a table similar to Table 1: The number of firm-year observations from the successive listing cohorts in each year. For my case firms prior to 1980 will be seasoned firms with new firms for 1980s wave, 1990s wave and 2000s wave

The table will look like as following (based on full sample)
Fiscal year Total number of firms Seasoned firms (firms from 1970s) 1980’s wave 1990s wave 2000s wave
1980 4013 3832 181
1981 4010 3543 467
1982 3946 3252 694
1983 4165 2964 1201
1984 4204 2589 1615
1985 4161 2199 1962
1986 4317 1839 2478
1987 4440 1469 2971
1988 4392 1036 3356
1989 4314 638 3676
1990 4339 352
1991 4366 680
1992 4471 1061
1993 4757 1601
1994 5034 2172
1995 5324 2816
1996 5863 3760
1997 5860 4265
1998 5536 4547
1999 5425 5070
2000 5099 403
2001 4816 738
2002 4710 1028
2003 4706 1391
Where 1980s wave column for the year 1980 is the new firms of 1980. For year 1981 is the summation of new firms in 1980 and 1981 and so forth. What I am unable to do when I move to year 1990 and onward I can’t identify how many of 1970s firms still exists and how many 1980s firms still exists in 1990, 1991 and so on.

I have attached partial sample Stata dta file. Your help will be highly appreciated.

Regards