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
Estimating discrete choice model using continuous v/s binary variablesHello, I am trying to estimate a discrete choice model, and I have a quick question on how I can st…
Help creating a graph, and add confidence intervals to another graphHi, Question 1: I have a dataset with patent count, a dummy to check wheter a firm engages in a M&a…
Standard deviation of annual changes in log-sales over the recent five yearsHi, I would like to calculate the standard deviation of annual changes in log-sales over the recent…
find robustHow can I solve the following error? must specify panelvar; use xtset r(459); …
how to code the following on statai have a group of friends around 50 .. and all make a choice of colour pink 10 , red 6 , black 10 , …
Subscribe to:
Post Comments (Atom)
0 Response to Dropping group of variables if the group does not contain a certain value
Post a Comment