I am working with panel data on board members of companies with DirectorID as an identifier. I want stata to recognize my data as panel data by using the function xtset, however I get the error "repeated time values within panel". I believe it is caused by the fact that I have boardmembers in my dataset who are active on boards of multiple companies and therefore have multiple observations per year.
This is an example of my data. As you can see DirectorID 61 is in the board for 2 different companies for the same year, in my total dataset there are a lot more directors who have this (even directors who work at 7 boards in the same year). To get rid of this error I think I have to create an extra variable which gives an unique value to a director per company, so for example the one with DirectorID-61 need two different values: one for INE079A01024 and one for INE012A01025. I was wondering if this is the right solution and if so if you could help me fix this problem.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear ISIN DirectorID Year "INE079A01024" "61" 2010 "INE012A01025" "61" 2010 "INE079A01024" "61" 2011 "INE012A01025" "61" 2011 "INE376G01013" "1266" 2010 "INE376G01013" "1266" 2011 "INE376G01013" "1266" 2012 "INE376G01013" "2011" 2012 "INE376G01013" "2011" 2013 "INE376G01013" "2011" 2014 "INE376G01013" "2011" 2015 "INE376G01013" "2011" 2016 "INE376G01013" "2011" 2017 "INE398R01022" "2011" 2018 "INE376G01013" "2011" 2018 "INE154A01025" "2169" 2010 "INE154A01025" "2169" 2011 "INE154A01025" "2169" 2012 "INE154A01025" "2169" 2013 "INE220J01025" "2332" 2015 "INE220J01025" "2332" 2016 "INE220J01025" "2332" 2017 "INE220J01025" "2332" 2018 end
0 Response to Panel data multiple observations per identifier
Post a Comment