Dear Statalists,
First of all, I would like to apologize for not being able to use dataex to enclose data but have to use attachment because my data set has a variable that exceeds max linessize.
I have a data set including three variables: PersonName CompanyNameTask1_71 NBiographies
Variable CompanyNameTask1_71 contains information about the company that the person in PersonName is currently working for.
Variable NBiographies summarize information about the person's work experience (in PersonName) including time spent with the company in CompanyNameTask1_71and several others.
I would like to create a new variable which is the working period of the person (in PersonName) as "Chief Financial Officer" (mentioned in NBiographies) at the company contained in CompanyNameTask1_71.
For example:
PersonName: Brlas, Mary Lauren (Prior Board)
CompanyNameTask1_71: Cliffs Natural Resources Holdings Pty Ltd
NBiographies: Mary Lauren Brlas, also known as Laurie, serves as a Director at Graphic Packaging International, LLC since January 11, 2019.She has been Director at Exelon Corporation since October 1, 2018. She serves as the Chief Financial Officer and Executive Vice President of CLF PinnOak LLC. Brlas served as the Chief Financial Officer and Executive Vice President at Newmont Mining Corporation from September 9, 2013 to 31, October 31, 2016. Among other career honors, she was named 2011 CFO of the Year by Crain’s Cleveland Business, and was named one of the Fortune500 Top 50 Female CFOs in 2015. She served as an Executive at Newmont Mining Corporation from October 31, 2016 to December 31, 2016. She joined Newmont Mining Corporation in 2013. She served as the President of Global Operations at Cliffs Natural Resources Inc. from October 21, 2012 to July 9, 2013. She served as an Executive Vice President of Global Operations at Cliffs Natural Resources Inc. from March 2008 to July 9, 2013. Brlas served as the Chief Financial Officer of Cliffs Natural Resources from December 11, 2006 to October 1, 2012 and served as its Executive Vice President of Finance & Administration from July 2012 to October 1, 2012. Brlas served as Principal Accounting Officer of Cliffs Natural Resources Inc. since September 2007. She served as Senior Vice President of Cliffs Natural Resources Inc. from December 11, 2006 to 2007 and also served as its Treasurer from December 11, 2006 to October 2007. She served as Chief Financial Officer and Senior Vice President of STERIS plc from April 2000 to December 8, 2006 and served as its Principal Accounting Officer. Prior to joining Steris in April 2000, she served at OfficeMax Inc., from September 1995 to March 2000, where she served as Senior Vice President and Corporate Controller. Brlas had been an Independent Director of Perrigo Company plc from August 11, 2003 until April 25, 2019 and served as its Chairman of the Board from April 24, 2016 to May 7, 2018. She has an extensive accounting and financial background spanning many years in various management positions. She has been a Director at Graphic Packaging Holding Company since January 11, 2019. She served as Independent Director of Calpine Corporation, a power company based in Houston, Texas, since August 10, 2016. She has been an Outside Director of Albemarle Corporation since June 23, 2017. She has been a Non-Executive Director of Cliffs Asia Pacific Iron Ore Holdings Pty since April 6, 2007. She served as a Director of Nova Chemicals Corporation from September 24, 2008 to July 2009. She served as a Director of Cliffs Natural Resources Inc. She served as a Director of Cliffs Natural Resources Holdings Pty until February 21, 2013. She has a distinguished list of honors and awards, including the honor of being named Ohio Financial Executive of the Year in 1997 by the Institute of Management Accountants. She is a Certified Public Accountant of AICPA and a Certified Management Accountant. Brlas obtained a Bachelor of Science degree in Business Administration from Youngstown State University.
The new variable will be: "from December 11, 2006 to October 1, 2012"
I have tried the commands as follows:
gen wanted88 = ""
gen wanted88_1 = ""
gen wanted88_2 = ""
forvalues x = 1/`=_N'{
ereplace wanted88 = ends(NBiographies) if _n==`x',punct("`=CompanyNameTask1_71[`x']'") last trim
ereplace wanted88_1 = ends(wanted88) if _n==`x',punct(".") head trim
}
but I do not know how to insert the condition "Chief Financial Officer" to the commands. And the commands also do not work properly as I have got wanted88_1: Mary Lauren Brlas, also known as Laurie, serves as a Director at Graphic Packaging International, LLC since January 11, 2019. It's not correct.
Any assistance is greatly appreciated.
Kh Trinh
Related Posts with Can I extract few letters from a string variable based on a conditional is another string variable?
When only one independent variable is non stationary does it make sense to run a cointegration test?Dear Stata users, after checking the stationarity of my panel data regression model: Y = f (X1, X2,…
Merging datasets in Stata on long strings and less precise matching criterionIn my new blog post, I have discussed a problem that I usually encounter in merging two datasets on …
runmlwin cross-lev interactions and random slope specificationHello, I am fitting a multilevel logit model using runmlwin following the procedure explicated in LE…
clad model-[variable] not found not foundwhen I use CLAD model, it always saids "[variable] not found post: above message corresponds to expr…
Testing if two coefficients are statistical differentDear Stataforum, I am currently investigating the Norwegian electricity market. I am running two r…
Subscribe to:
Post Comments (Atom)
0 Response to Can I extract few letters from a string variable based on a conditional is another string variable?
Post a Comment