Hi all,
Does anyone have a good way to check a if companies in panel data are missing any years? The problem I'm trying to solve: I am calculating annual revenue growth and if a year is missing (ex. 2015) I want to be sure I'm not calculating the revenue growth from 2014 to 2016 as though it's annual revenue. My problem is that I have companies entering and exiting the data at different times, so I can't just see if each company is reporting for the full 35 years of my period. What I'm hoping to do: Find a way to confirm that if an ID enters in 1992 and exits in 1999, then every year between those two years is present. Any ideas?
Does anyone have a good way to check a if companies in panel data are missing any years? The problem I'm trying to solve: I am calculating annual revenue growth and if a year is missing (ex. 2015) I want to be sure I'm not calculating the revenue growth from 2014 to 2016 as though it's annual revenue. My problem is that I have companies entering and exiting the data at different times, so I can't just see if each company is reporting for the full 35 years of my period. What I'm hoping to do: Find a way to confirm that if an ID enters in 1992 and exits in 1999, then every year between those two years is present. Any ideas?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float ID int FiscalYear float adjustedRevenue 1 1989 . 1 1990 . 1 1991 . 1 1992 . 1 1993 . 1 1994 . 1 1995 . 1 1996 . 1 1997 . 2 1999 10.790997 2 2000 17.897474 2 2001 10.27825 2 2002 1.2548368 2 2003 .4863041 2 2004 .7213615 2 2005 .880989 2 2006 .670846 2 2007 .6115783 2 2008 .4915955 2 2009 .4933508 2 2010 .5064929 2 2011 .5410033 2 2012 1.0400256 2 2013 1.380583 2 2014 .28833982 2 2015 .09384204 2 2016 .06923842 2 2017 .5256655 2 2018 .2066783 2 2019 .283 3 2006 .013949539 3 2007 .57088864 3 2008 19.61751 3 2009 5.395875 3 2010 79.07621 4 1980 . 4 1981 . 4 1982 13.23058 4 1983 23.79458 4 1984 37.98192 4 1985 25.28771 4 1986 16.759996 5 1996 5.911559 5 1997 33.63363 5 1998 93.91238 5 1999 151.19211 5 2000 215.2314 5 2001 244.016 5 2002 239.5701 5 2003 260.2463 5 2004 286.4847 5 2005 311.4879 5 2006 315.356 6 1995 3.269524 6 1996 5.430878 6 1997 15.321898 6 1998 9.992581 6 1999 8.463076 6 2000 7.424743 6 2001 9.947671 7 1998 345.987 7 1999 454.0336 7 2000 571.96204 7 2001 638.4048 7 2002 706.5811 7 2003 785.8924 7 2004 817.423 7 2005 877.9507 7 2006 991.3569 7 2007 1125.2523 7 2008 1091.7125 7 2009 850.7917 7 2010 782.8481 7 2011 783.9854 7 2012 797.5649 7 2013 807.166 7 2014 816.7955 7 2015 1209.7059 7 2016 1249.5127 7 2017 1244.9355 7 2018 1172.7936 7 2019 1248.623 8 2017 74.14074 8 2018 148.96416 8 2019 245.893 9 2016 134.06581 9 2017 153.8093 9 2018 264.37518 9 2019 567.579 10 1975 79.97598 10 1976 75.070595 10 1977 65.71144 11 2018 45.99356 11 2019 58.343 12 2003 . 12 2004 288.90866 12 2005 367.4065 12 2006 425.3937 12 2007 468.2618 13 1995 1.8620687 end label values ID ID label def ID 1 "007 PRECIOUS METALS INC", modify label def ID 2 "01 COMMUNIQUE LABORATORY INC", modify label def ID 3 "0373849 B C LTD", modify label def ID 4 "1 POTATO 2 INC", modify label def ID 5 "1-800 CONTACTS INC", modify label def ID 6 "1-800-ATTORNEY INC", modify label def ID 7 "1-800-FLOWERS.COM", modify label def ID 8 "10X GENOMICS INC", modify label def ID 9 "111 INC -ADR", modify label def ID 10 "1225 MAPLE CORP", modify label def ID 11 "17 EDUCATION & TE -ADR", modify label def ID 12 "180 CONNECT INC", modify label def ID 13 "180 DEGREE CPTL CORP", modify
Comment