Home

ShannonIndex

ShannonIndex, commonly called the Shannon diversity index, is a metric used to quantify biodiversity in ecological communities and, by extension, in information theory. It measures the uncertainty in predicting the species identity of a randomly chosen individual from a community, reflecting both species richness and evenness.

The index is computed as H' = - sum_{i=1}^S p_i log p_i, where S is the number of species

ShannonIndex is widely used to compare biodiversity across sites, treatments, or time, in ecology and microbiology.

Interpretation caveats: H' is sensitive to sample size and the presence of rare species; under-sampling can

and
p_i
is
the
relative
abundance
of
species
i
(the
number
of
individuals
of
species
i
divided
by
the
total
number
of
individuals).
Terms
with
p_i
=
0
contribute
zero.
With
natural
logarithms,
H'
is
measured
in
nats;
using
base
2
yields
bits.
The
theoretical
maximum
for
a
given
S
is
H'max
=
ln(S),
achieved
when
all
species
are
equally
abundant.
The
evenness,
E
=
H'
/
H'max,
ranges
from
0
to
1
and
summarizes
how
evenly
individuals
are
distributed
among
species.
It
can
be
computed
from
abundance
data
or,
less
informatively,
presence-absence
data.
Higher
values
indicate
greater
diversity.
bias
estimates
downward.
Comparability
between
studies
requires
standardization
of
sampling
effort
and,
when
possible,
rarefaction
or
other
sample-size
corrections
and
an
explicit
statement
of
the
logarithm
base
used.