I have panel data of company year-observations. I want to drop companies where there is missing information for all years on whether they interacted with a research and technology organisation, but keep the missing company-year observations if there is data for that company in other years. My data looks something like this, where the variable id is a company identifier, year is the year and rto is 1 if the company interacted with a company that year, 0 if they did not, and . if there is no information on whether they interacted:
What I need is a command that will drop company 3 from the dataset but not the observation for company 2 in year 3, because there is data on the company's RTO-interaction for the other years.
Any help much appreciated!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(id year rto) 1 1 0 1 2 1 1 3 0 2 1 1 2 2 1 2 3 . 3 1 . 3 2 . 3 3 . end
Any help much appreciated!

Comment