Hi everyone!
I was wondering if someone could lend a hand.
I have panel data on firms board of directors. The panel is made up of observations of individual directors all of whom sit on the board of various firms.
I am trying to create a new variable 'CEO_Duality_Firm'. CEO Duality occurs when a person holds both the role of chairman and CEO. I have created a binary variable, 'CEO_Duality_Individual', which shows when someone is both CEO and Chairman. Does anyone have any advice on what code I should run to create a new binary variable, 'CEO_Duality_Firm', which marks all members of a certain board either 1 or 0 depending on whether or not there is someone who is both CEO and Chairman in that year?
For example, in 2008 for the firm "Kelda Group Ltd" there is not CEO Duality so in the new variable 'CEO_Duality_Firm' all members of the board for that year should be marked 0. In year 2009, for "Kelda Group Ltd" there is a CEO/Chairman, as indicated by the 'CEO_Duality_Individual' variable, so I want to mark all members of that firm in that year 1 in the new variable 'CEO_Duality_Firm'.
I have attached a sample of my data below
. dataex A D K CharacteristicsofRoles CEO_Duality_Individual
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str18 A str128 D str73 K str58 CharacteristicsofRoles float CEO_Duality_Firm
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Stephen Bernard Lilley" "NED" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Kevin Ian Whiteman" "CEO" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "John Alan Napier" "Chairman" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "John George Duthie-Jackson" "NED" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Richard John Cole" "NED" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Stuart Harvey Baldwin" "NED" 0
"Mar 2008" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Allison Margaret Bainbridge" "GFD" 0
"Mar 2009" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Allison Margaret Bainbridge" "GFD" 0
"Mar 2009" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Stuart Douglas McFarlane" "Company Secretary" 0
"Mar 2009" "Kelda Group Ltd (Kelda Group plc prior to 07/2008)" "Kevin Ian Whiteman" "Chairman/CEO" 1
Related Posts with Creating a new group variable in Panel Data
Series 0 not found using grc1leg2Dear all, I am using Stata 14 on Windows 10. The following code is supposed to create a combined gra…
Reshape data in order to calculate gini coefficient panel data using income groupsDear Statalist, I'm trying to calculate the Gini of counties using the the population of 20+ income…
Merger Simulation Nested Logit Model (Björnerstedt & Verboven, 2013)Dear forum, I follow the paper written by Björnerstedt and Verboven (2013) and Berry (1994) to simu…
ITSA Error on Monthly Time Series Data with a Gap Due to Zero CountHi, I am currently looking at datasets from several hospitals to assess the impact of COVID-19 pande…
Drop if Strmatch with multiple conditionsHello everyone, I'm new to STATA and i have the following problem: I want to drop all observations,…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new group variable in Panel Data
Post a Comment