Calculate estimates of the Shannon-Wiener index after pooling over several samples, grouped by a factor variable.
Usage
estShannonf(X, f)
Value
A list, containing the elements:
estimae
a named numeric vector, the groupwise Shannon indices with bias correction according to Fritsch and Hsu (1999)
estraw
a named numeric vector, the groupwise Shannon indices, without bias correction
varest
a named numeric vector, the groupwise variance estimates of the Shannon indices
table
a matrix, giving the summarized counts of the groups in the rows
Arguments
X
a data.frame of dimension n times p with integer entries, where n is the number of samples and p is the number of species
f
a factor variable of length n, grouping the observations in X
Details
The function splits X according to the levels of the grouping variable f, builds the sum over each column and calculates the Shannon index ove the resulting counts.
References
Fritsch, KS, and Hsu, JC (1999): Multiple Comparison
of Entropies with Application to Dinosaur Biodiversity. Biometrics 55, 1300-1305.