I have created the Stata commands below for my research on diversity, inequality, and segregation. The associated ado and help files can be downloaded for research and instructional purposes.


Entropy

Finds Theil’s (1972) Entropy index for each observation or for a given group and saves it in a new variable.

Information

Finds Theil's (1972) Information (H) index for all observations in the data set or within each bysort group.
 

Gini

Finds the Gini inequality index for observations within a particular sub-group and saves it in a new variable.

Segregation

Finds the Segregation or Dissimilarity Index for all observations in the data set or within each bysort group.