I’ve just uploaded a new Stata command to the SSC archive, bhatt. The command calculated the Bhattacharyya Coefficient and Bhattacharyya Distance measures of overlap in two distributions. Very cool. Install from with Stata with the command net install bhatt.
bhatt calculates the Bhattacharyya Coefficient (BC) and Bhattacharyya Distance (BD) for comparing the degree of overlap between two distributions (see Bhattacharyya 1943). The Bhattacharyya Coefficient divides the overall distribution into a number of bins, and compares the proportion of each group within each bin. It ranges from 0 to 1, where 0 indicates no overlap between the two group distributions and 1 indicates complete overlap. The Bhattacharyya Distance is a natural log transformation of BC.
For N bins, the formulae for BC and BD are given as:
where p and q are the proportion of each group in bin i.
For full details of the measure, see: Bhattacharyya, A. (1943) ‘On a measure of divergence between two statistical populations defined by their probability distributions’ Bulletin of the Calcutta Mathematical Society, 35: 99-109.