Hello all,

I'd like to test if total diversity differs between two communities. For
each community several samples were taken and abundances collapsed over
groups to compute total diversity for each group. I tried to use
vegan::oecosimu to test non-randomness of my statisitc (difference in
Simpson-Diversity indices of collapsed abundances) - however, I am not
quite sure if I oversee posssible pitfalls:

library(vegan)
data(dune)

# a grouping variable:
gr <- gl(2, nrow(dune)/2)

divdiff <- function(x) abs(diversity(colSums(x[gr == "1", ]), "simp") -
                           diversity(colSums(x[gr == "2", ]), "simp"))
# testing function:
divdiff(dune)

oecosimu(dune, divdiff, "r2dtable", nsimul = 1999)
# oecosimu with 1999 simulations
# simulation method r2dtable
# alternative hypothesis: true mean is not equal to the statistic
#           statistic        z     2.5%      50% 97.5% Pr(sim.)
# statistic   0.00275 -0.20996  0.00013  0.00280  0.01     0.98

	[[alternative HTML version deleted]]

