Hi all,
I've searched a few posts on this and I can't seem to quite get the code right for my dataset. I am trying to do a simple diversity index with 3 variables in an ego network. So each participant gives a list of 6 names, and then of that list I have their race of the name given (black, white, other).
I have homogeneity scores via percent (i.e. how many names are black divided by total number of names given). But how do I translate this into a broad index that includes all three options?
I searched some code and found:
egen Blau = total((freq/total)^2)
But this would only be for the frequency of one variable, right? How do I get all 3 of them in there?
Thank you!
I've searched a few posts on this and I can't seem to quite get the code right for my dataset. I am trying to do a simple diversity index with 3 variables in an ego network. So each participant gives a list of 6 names, and then of that list I have their race of the name given (black, white, other).
I have homogeneity scores via percent (i.e. how many names are black divided by total number of names given). But how do I translate this into a broad index that includes all three options?
I searched some code and found:
egen Blau = total((freq/total)^2)
But this would only be for the frequency of one variable, right? How do I get all 3 of them in there?
Thank you!
Comment