How to compare frequency distributions I have one categorical variable that can assume 5 possible values: 1, 2, 3, 4, 5. I observe the value of the variable in two samples of different size. Now I want to compare the frequency distribution of my variable in the two sample.
Is there any statistic that measures the concentration of the distribution (something like the Gini coefficient, but not cumulative), so to take the value of 1 if all observations of the sample are in one category and 0 if they are equally distributed across the 5 categories. Looking at the statistic, I could then say that one sample is more heterogeneous than the other. 
 A: Here's one such suggestion: 
Assuming nominal categories labelled $1, 2, ..., k$
Consider the sum of the squares of the proportions in each category, 
$$\sum_{i=1}^k p_i^2$$
If all values are in 1 category it takes the value 1 and if they're uniformly spread across categories it takes the value $k/k^2 = 1/k$.
So subtract $\frac{1}{k}$ and divide by $1-\frac{1}{k}$ to give it the right range.
That leaves us with the concentration coefficient $\frac{(\sum_{i=1}^k p_i^2)-\frac{1}{k}}{1-\frac{1}{k}}=\frac{(k\sum_{i=1}^k p_i^2)-1}{k-1}$
Note that this is a linear rescaling of the Simpson diversity index to make it a concentration (i.e. flipped around) and with the desired endpoints.
Edit: Note added later - the Simpson index is also called the Herfindahl index (one of many cases where the same thing is called different names in different areas), and the above concentration measure is the normalized Herfindahl index $H^*$.
There are other such indexes which you might prefer to similarly modify.
As another possibility from economics, there's also the Gini coefficient.

For ordered categories (where further apart is more heterogeneous), you might want to consider subtracting the second of the two polarization indexes discussed here from 1.
Alternatively, if you need uniformity to be zero, and 50-50-polarizaton to be negative, a simple rescaling can achieve that.
For the ordered case, further clarification is needed.
A: Cliff's Delta may be the way to go. It is a non-parametric effect size statistic which ranges from -1 to 1. 1 or -1 mean the distributions are completely divergent and a zero means the distributions are exactly the same. Delta's of 0.147, 0.33, and 0.474 correspond to Cohen's d's of 0.2, 0.5, and 0.8.. See this for a comparison of the two effect sizes: http://tien-nguyen.github.io/effect-size-and-its-interpretation/
You can then convert to Common Language (CL) effect size to provide more clarity for your audience (and one's self maybe?)
A: see http://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/chi2samp.htm
or 
NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)
Copyright (C) 1988-1992 by Cambridge University Press. page 620 and further
greetings
