BookmarkSubscribeRSS Feed
Fer_
Fluorite | Level 6

Hello all, 

I want to create a dummy variable which equal to one if CEO turnover happen one year before my event and equals to zero if CEO turnover happen one year after the event. I have gvkey and year for each firm. Executive ID for CEOs and also a date for the event (year of each event). 

Here is my dataset: 

GVKEY          year      Executive ID    

001050          1990     01891                    

001050          1991      01891

001050          1993     01891

...

001052          2001     21841

001052          2002    21841

001052         2003     21841

....

I appreciate your help. 

8 REPLIES 8
andreas_lds
Jade | Level 19

Sorry, but i don't understand what you expect as output. Also i don't see the variable containing the event date in your data, in fact i don't see data at all. "Data" means a working data step creating the data you have.

Fer_
Fluorite | Level 6

Thanks for your reply. First, I want to calculate CEO turnover for the dataset that I have which has GVKEY, Executive ID and year.

Then, if I need a dummy variable which equals to one if CEO turnover happen one year before my event and equals to zero if CEO turnover happen one year after the event. 

The main question is calculating CEO turnover.

andreas_lds
Jade | Level 19

For both gvkey you have posted the ExecutiveID is constant, so: what do expect exactly as output from the information you have posted?

PaigeMiller
Diamond | Level 26

@Fer_ wrote:

Thanks for your reply. First, I want to calculate CEO turnover for the dataset that I have which has GVKEY, Executive ID and year.

Then, if I need a dummy variable which equals to one if CEO turnover happen one year before my event and equals to zero if CEO turnover happen one year after the event. 

The main question is calculating CEO turnover.


What event are you referring to? How would we detect this event from the data you show?

--
Paige Miller
Fer_
Fluorite | Level 6

Let me change my dataset to : 

event=1 means that company have the event at that year and 0 means it does not have that event. 

 

GVKEY          year      Executive ID    Event 

001050          1990     01891                    0

001050          1991      01891                    0

001050          1993     01891                     1

...

001052          2001     21841                    0

001052          2002    21841                     1

001052         2003     21841                     1

PaigeMiller
Diamond | Level 26

You haven't addressed the issue from @andreas_lds , who said

 

so: what do expect exactly as output from the information you have posted?

Please show us what the output from this example should look like.

--
Paige Miller
Fer_
Fluorite | Level 6

I need a dummy variable which equals to one if CEO turnover happen one year before the event and equals to zero if CEO turnover happen one year after the event.  

The process of the codes will be like:

First, I want to have CEO turnover for the dataset according to  GVKEY, Executive ID and year.

Second, having a dummy variable which equals to one if CEO turnover happens one year before the event (event=1) and zero, one year after that event. 

It has two steps, calculating CEO turnover and then creating dummy variable when event=1. 

dummy =1 when event=1 and CEO turnover happens one year before the year that I have event=1 and dummy=0 when event=1 and CEO turnover happens one year after the year that I have event=1. 

PaigeMiller
Diamond | Level 26

I asked:

 

Please show us what the output from this example should look like.

 

You didn't show us what you want. Please SHOW US the desired output data set from this data.

 

Also, you do not have even a single instance of CEO turnover in your data. Please provide a data set that represents the problem description.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 910 views
  • 0 likes
  • 3 in conversation