How to measure if a categorical distribution is concentrated in a very few bins I'm trying to think of a way to measure that a categorical distribution of any size is concentrated in only a few bins, so not uniform. The best way I can think of is checking entropy, but that's kind of hard to assess, because either it's close to a uniform distribution or it's not unless there's something I'm missing. I also heard about kurtosis, but that's more a metric of tailedness. I'd like that, for example, if I have 5 classes and 2 of the classes make up 80% of the distribution, then I have a metric that can reflect this.

Imagine your categorical variable (with many levels) is species (in biostatistics context). Then your question can be formulated as about how to measure biodiversity. The same question can be asked in many contexts, for instance, in economics about income inequality. So you are asking for a way of measuring diversity or inequality.
There are many such indices, for instance Gini coefficient or Simpson coefficient. Below some other posts here about diversity indices:

*

*How can I use R to asses the biodiversity of reef zones?


*ecologists, if I have diversity data (Shannon's index) for years and sites how can I produce data just for the sites (explained better below)


*Measuring how well data is evenly dispersed


*How is the Herfindahl-Hirschman index different from entropy?
