Dear Statalist users,
I have a question that I cannot seem to figure out myself. I have looked at the forums, and although I have found many helpful topics (like: https://www.statalist.org/forums/for...kill-diversity), the situation does not apply to me. I have also figured out that there appear to be many names for the Blau-index, like the Simpson's, Herfindahl’s, and Herfindahl-Hirschman’s. In this post, I will explain as clearly as I can what I try to achieve.
I have the dataset below, which consists of directors per firm per year, along with the number of awards they have received. I want to capture the heterogeneity in the number of awards in a board year. However, since the Blau-Index requires categories, and Awards is a count vaiable, I need to create the category myself. Therefore, I want to use the mean of the sample, which in this case is 53. My categories for the Blau-index thus exist of: 1. above 53, and 2. below 53.
My question is thus: how could I calculate the Blau-Index by CompanyID and Year, with the category stated above (above/below the mean)?
Note, I have tried the following:
And although this works for the snippet of my data above, it does not seem to work for my whole dataset. I get an error 'too many values', which may be correct, since my dataset is big.
Thank you for your time and efforts. If something is unclear, please let me know.
I have a question that I cannot seem to figure out myself. I have looked at the forums, and although I have found many helpful topics (like: https://www.statalist.org/forums/for...kill-diversity), the situation does not apply to me. I have also figured out that there appear to be many names for the Blau-index, like the Simpson's, Herfindahl’s, and Herfindahl-Hirschman’s. In this post, I will explain as clearly as I can what I try to achieve.
I have the dataset below, which consists of directors per firm per year, along with the number of awards they have received. I want to capture the heterogeneity in the number of awards in a board year. However, since the Blau-Index requires categories, and Awards is a count vaiable, I need to create the category myself. Therefore, I want to use the mean of the sample, which in this case is 53. My categories for the Blau-index thus exist of: 1. above 53, and 2. below 53.
My question is thus: how could I calculate the Blau-Index by CompanyID and Year, with the category stated above (above/below the mean)?
Code:
clear input int(CompanyID Year DirectorID) str1 Gender int Awards 1111 2008 4854 "M" 45 1111 2008 2938 "F" 14 1111 2008 4927 "F" 120 1111 2008 9068 "M" 76 1111 2009 4854 "M" 45 1111 2009 2938 "F" 76 1111 2010 4854 "M" 46 2222 2008 4275 "F" 54 2222 2009 5827 "M" 65 2222 2009 5283 "M" 34 2222 2010 6912 "M" 12 2222 2010 4917 "F" 43 2222 2010 4854 "M" 59 end
Code:
gen AwardsDummy = 0 replace AwardsDummy = 1 if Awards>53 bysort CompanyID Year: divcat AwardsDummy , gv gen_gv(H_AwardsDummy)
Thank you for your time and efforts. If something is unclear, please let me know.
Comment