Hi Guys,
I'm currently writing my thesis about the influence of the tenure of outside directors on earnings quality. I also want to investigate whether having financial expertise has an effect on the relationship between tenure and earnings quality. I have broken down a sample of companies from the USA in the period from 2010-2019 with several outside directors per company year and I want to use a dummy variable that shows the value of 1 if at least one outside director financial expertise has in a company year. I have currently created the following do file to create this dummy variable:
gen OUTSIDE = 0
replace OUTSIDE = 1 if (classification=="I")
drop if OUTSIDE == 0
gen cusip_6d = substr(CUSIP, 1, 6)
drop CUSIP
gen Financial_Expertise = 0
replace Financial_Expertise = 1 if Financial_Expert == "Yes"
sort cusip_6d year
duplicates drop cusip_6d year, force
I have attached a snap of the cleansed data which is generated after implementing the do-file. As you can see there is a dummy variable created under the name Financial_Expertise but there is an indication problem within it. In some cases, the dummy variable Financial_Expertise indicates a value of 0 in a given company year while in that specific company-year there is an outside director with financial expertise. This is for example the case for the first dummy-variable of AAON. In the first picture, the dummy variable shows an ''0'' in the company year 2010 which means that none of the outside directors is in possession of financial expertise. However, in the second picture you can see that there is indeed one outside director with financial expertise.
Do you guys have any idea how I can adjust my do-file so that the dummy variable shows a 'correct' value in terms of the presence of a financial expert per company year?
I would like to hear from you and thank you in advance
Kind Regards,
Roy
Related Posts with Creating Dummy Variable each company-year with multiple observations
Store tab command's resultsHi all! I created a variable indicating in which income decile individuals of a population are. I t…
Robust option in a ols modelHi everyone, I was wondering if one can use robust option in a ols regression model that includes bo…
IV Regression Panel Data - xtivreg - lagged VariablesHello, I am working with StataIC16 and the panel data set mathpnl**, for the years 1992 - 1998- I w…
How do I export multiple diagnostic tests to one .csv table?Hello STATAlist friends! I'm working with STATA 15 on a project validating a several tests to gold s…
How to extract one variable from a string?We have a dataset of different movies but genres contain more than one variable. For example, under …
Subscribe to:
Post Comments (Atom)
0 Response to Creating Dummy Variable each company-year with multiple observations
Post a Comment