I am working in Stata and have data that lists out portfolios(houseID), the year and month, the stockID and the stock's return. The data spans several years. And looks like:
I am essentially trying to isolate a sub-sample of the data. I would like to keep only those houses and their data if their first portfolio observation was in February 2000. In the above data, I'd like to drop houses 223 and 382 and only keep the data for 448.
My first attempt was to do something like:
by HouseID: keep if....
but I am continually botching it. Does anyone have any ideas? Thanks for the help!!