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!
Related Posts with Drop observations given multiple conditions
Help on fixed effectsDear all, I'd need some advice on how to deal with fixed effects. I am currently working on a cross…
Reverse a numeric variableHi all, so i have a numeric variable with a lot of values, that are decimal: 4,626276 5,162374 5,6…
mi impute chained trace plotsHi all, I am running the command mi impute chained (regress) x y z = a b c, add (10) burnin (100) r…
Help merging excel files in stata with 3 variablesI have 3 excel files with poverty data at the county level for the years 1980,1990, and 2000. I have…
Help needed: creating flag to Identify at least 3 consecutive years of data (without discarding other cases)Dear Sir/Madam I have a panel dataset (each company has one or multiple years of data, but there ar…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations given multiple conditions
Post a Comment