Dear all,

I am a stata beginner so this question might sound stupid. I have a dataset that list persons in a board of a public company for a given year. Moreover, I have specified whether someone is the CEO or not and if there has been a CEO succession event. The data is sorted by company and year. Now, I want to drop all the observations for a given company if there is no CEO succession event (for example, when the CEO remains in function in the whole period). If there is a CEO succession event, I want to keep all the observations (including the years where no succession is present). Looking at the screenshot below, I would like to drop all companies that look like that (where the CEO in the first year is also CEO in the last year). So, conceptually, all companies would be a separate group, then if this group (company) does not contain a ceo_change, the whole group gets dropped and if it does contain a ceo_change, the whole group stays.

I hope someone can help me with this, thanks in advance!

Array