In my research I jumped into another challenging variable that I think needs extensive programming. I have come quite a way, but I am not sure how to formally put in STATA. Here is an example of the data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double director_detail_id str12 CUSIP double year float hasfemale 1 "922944103" 2007 1 1 "344849104" 2008 1 1 "344849104" 2009 1 1 "344849104" 2010 1 1 "344849104" 2011 1 1 "344849104" 2012 1 2 "638620104" 2007 0 2 "638620104" 2008 0 2 "638620104" 2009 0 2 "638620104" 2010 0 3 "28176E108" 2007 1 4 "053611109" 2007 1 4 "053611109" 2008 1 4 "053611109" 2009 1 4 "053611109" 2010 1 4 "053611109" 2011 1 4 "053611109" 2012 1 5 "053611109" 2007 1 5 "053611109" 2008 1 5 "053611109" 2009 1 6 "17163B102" 2007 0 6 "17163B102" 2008 0 8 "210371100" 2007 1 8 "210371100" 2008 1 9 "017361106" 2007 1 9 "017361106" 2008 1 9 "631103108" 2008 1 9 "631103108" 2009 1 9 "017361106" 2009 1 9 "017361106" 2010 1 9 "631103108" 2010 1 9 "631103108" 2011 1 12 "170388102" 2007 1 12 "141487AC2" 2007 1 12 "78387G103" 2007 1 12 "14149Y108" 2008 1 12 "00206R102" 2008 1 12 "00206R102" 2009 1 12 "00206R102" 2010 1 12 "00206R102" 2011 1 12 "00206R102" 2012 1 12 "00206R102" 2013 1 12 "00206R102" 2014 1 12 "00206R102" 2015 1 13 "141487AC2" 2007 1 13 "025816109" 2007 1 13 "025816109" 2008 1 13 "988498101" 2008 1 13 "025816109" 2009 1 13 "655664100" 2009 1 13 "988498101" 2009 1 13 "655664100" 2010 1 13 "025816109" 2010 1 13 "988498101" 2010 1 13 "655664100" 2011 1 13 "025816109" 2011 1 13 "988498101" 2011 1 13 "655664100" 2012 1 13 "025816109" 2012 1 13 "988498101" 2012 1 13 "025816109" 2013 1 13 "655664100" 2013 1 13 "988498101" 2013 1 13 "988498101" 2014 1 13 "655664100" 2014 1 13 "025816109" 2014 1 13 "025816109" 2015 1 13 "655664100" 2015 1 13 "988498101" 2015 1 13 "655664100" 2016 1 13 "988498101" 2016 1 13 "025816109" 2016 1 13 "988498101" 2017 1 13 "025816109" 2017 1 13 "655664100" 2017 1 13 "988498101" 2018 1 13 "988498101" 2019 1 14 "925524AC4" 2007 1 14 "06605LAF6" 2007 1 14 "100599208" 2007 1 14 "060505104" 2008 1 14 "124857202" 2008 1 14 "124857202" 2009 1 14 "060505104" 2009 1 14 "67019E107" 2009 1 14 "124857202" 2010 1 14 "67019E107" 2010 1 14 "060505104" 2010 1 14 "124857103" 2011 1 14 "060505104" 2011 1 14 "124857103" 2012 1 14 "060505104" 2012 1 14 "664397106" 2012 1 14 "124857103" 2013 1 14 "664397106" 2013 1 14 "060505104" 2013 1 14 "30040W108" 2014 1 14 "124857103" 2014 1 14 "060505104" 2014 1 14 "30040W108" 2015 1 end
I tried on my own to work around this problem via dummies. In which connections counts how often a director is in a firm in which there is a woman for a given year.
Code:
(i) egen connections=count(director_detail_id) if hasfemale==1, by(director_detail_id year) (ii) replace connections=0 if connections==. (iii) replace connections=0 if connections==1 & hasfemale==1 (iv) replace connections=1 if connections>1
0 Response to Programming dummy
Post a Comment