Hi everyone,
I am working on a state dataset where I need to keep observations of firms with non-missing assets in 1993
Example of the dataset is as follows:
input long gvkey double(fyear at)
1004 1992 100.242
1004 1993 .
1004 1994 425.814
1004 1995 437.846
1004 1996 529.584
1004 1997 670.559
1004 1998 726.63
1004 1999 740.998
1004 2000 701.854
1004 2001 710.199
1004 2002 686.621
1004 2003 709.292
1004 2004 732.23
1004 2005 978.819
1004 2006 1067.633
1004 2007 1362.01
1004 2008 1377.511
1004 2009 1501.042
1004 2010 1703.727
1004 2011 2195.653
1004 2012 2136.9
1004 2013 2199.5
1004 2014 1515
1004 2015 1442.1
1004 2016 1504.1
In this case, I will need to drop the whole gvkey = 1004 given that there is a missing asset value in 1993. Please be aware, the dataset consists of thousands of gvkeys (individual firms) and I need to drop the whole observation for every gvkey given that asset in 1993 is missing.
Could anyone please help me how I can proceed with this as I am completely stuck by using either the drop or the keep command.
Thank you very much!
0 Response to Drop observations given multiple conditions
Post a Comment