Hi everyone!
I'm currently writing my bachelor's thesis and could do with some help. I have a dataset of companies with the tobin's q from 3 years (2007,2008 and 2009). The unique identifier is gvkey. I'd like to drop all the observations of companies that only have the tobin's q for one or two of the years, but not all three. Also, some of the companies have three values, but they are all in the same year, eg. 2007. I would like to drop these companies from the data set as well.
Essentially, I want to keep only the companies that have the Tobin's q for years 2007,2008 and 2009. I know I have to do a for loop but that's about where my knowledge ends. Anybody know what I could do?
I'm currently writing my bachelor's thesis and could do with some help. I have a dataset of companies with the tobin's q from 3 years (2007,2008 and 2009). The unique identifier is gvkey. I'd like to drop all the observations of companies that only have the tobin's q for one or two of the years, but not all three. Also, some of the companies have three values, but they are all in the same year, eg. 2007. I would like to drop these companies from the data set as well.
Essentially, I want to keep only the companies that have the Tobin's q for years 2007,2008 and 2009. I know I have to do a for loop but that's about where my knowledge ends. Anybody know what I could do?
Comment