*! bhatt version 1.0 October 2015 by Graham K. Brown
help bhatt (grahamkbrown.net)

Title

bhatt -- Calculates the Bhattacharyya Coefficient and Bhattacharyya Distance measures
of overlap between two population distributions

Syntax

bhatt
varname
[if] [in],
group(groupvar)
[ bin(#) ]

options

* group() variable defining the groups

bin() specify number of bins to be used

* group() is required.

varname specifies the variable along which distribution is to be compared.

groupvar specifies the variable that identifies the groups to be compared.

Description

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 i=1/N bins, BC is calculated as the sum of sqrt[p(i)q(i)], where p(i) and q(i) are, repsectively, the proportion of groups
p and q in bin i. BD is given by the formula BD=-ln(BC).

Options

group(groupvar)
specifies the variable that identifies the two groups to be compared. groupvar must identify exactly two groups.

bin(#)
specifies the number of bins the overall distribution is to be divided into. If bin(#) is not specified,
a default value of 10 is used.

Saved results

bhatt saves the following in r():

Scalars

r(bc) Bhattacharyya Coefficient

r(bd) Bhattacharyya Distance

Author

Graham K. Brown

Professor of International Development

University of Western Australia

Perth, Australia

graham.brown@uwa.edu.au

References

Article: Bhattacharyya, A. (1943) 'On a measure of divergence between two statistical populations
defined by their probability distributions' Bulletin of the Calcutta Mathematical Society, volume 35, pp. 99-109: MR0010358