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
Related Posts with Dropping group of variables if the group does not contain a certain value
quantile regression with interaction termsHello, I'm confused about how to include an interaction variable in my regression. Indeed, I run a q…
frames questionRelational databases can hold data more efficiently than flat files in the sense that when you merge…
I can't simulate a bootstrap program with multiple resultsI am trying to calculate bootstrap standard errors for many regressions. I am applying Two-Sample In…
SSC RIF updateDear all Thanks to Prof Baum, an update for RIF is up! This update comes with 1 addition: -bsrifhdre…
Goodness of fit -xtreg, re vce(cluster var)- and -xtlogit-Hello everyone, I am running a random effects panel regression with -xtreg, re- and clustered stand…
Subscribe to:
Post Comments (Atom)
0 Response to Dropping group of variables if the group does not contain a certain value
Post a Comment