[R-sig-eco] Testing difference between diversity indices with vegan::oecosimu

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Apr 26 11:43:24 CEST 2012


On Thu, 2012-04-26 at 09:17 +0200, Kay Cichini wrote:
> @David,
> to ask for statistical *and* biological significance (effect size) is
> indeed essential and
> this statement does apply in general - but it does not contribute to a
> solution of my problem at all..
> 
> @Chris,
> as I want to test total diversity of each community (diversity calculated
> from samples collapsed over groups) I have only two values and thus
> ANOVA-like tests are not an option.

So you have two numbers? Diversity in Comm1 computed by summing total
number of unique species in Comm1 and the same but for Comm2. Hmm....

How about a null model that presupposes that Comm1 and Comm2 have the
same diversity? Under that model can we reallocate the original samples
(before you collapsed down to the two communities) to one or other of
the communities, collapse to the community level, then compute the
difference in diversity in permuted Comm1 and Comm2. Repeat a lot of
times and look to see if the observed difference is extreme relative to
the Null distribution?

Would that make sense? If so you could cook that up with functions in
vegan or the permute package.

If you have the original counts, are they done to counts of species and
you are just extracting diversity indices from that or do you only have
the diversity indices?

If the former then the multivariate dispersion of the species counts in
samples for Comm1 and Comm2 will be equivalent if they are similarly
diverse. I.e. they should have the same spread/variance. That can be
tested using the work of Marti Anderson (her PERMDISP program) which is
available as function betadisper() in vegan (though the method is biased
with unbalanced sample designs - thanks to some excellent detective work
that has just been brought to our attention - so do check out the
R-forge version for changes to betadisper(). I'm not sure if the work
has been done to add a correction in R-Forge or just in Jars' Github
repo?).

Alternatively, and perhaps more powerfully, see David Warton's mvabund
package which has more formal glm-based tests of the distance-based
methods Marti developed in NPMANOVA and PERMDISP.

G

> Kind regards,
> Kay
> 
> ps: Sorry Chris for double posting.
> 
> 
> >
> > 2012/4/26 Chris Howden <chris at trickysolutions.com.au>
> >
> >> Standard Hypothesis statistical testing often starts with the null
> >> hypothesis that 2 things are identical, or that 2 population means are
> >> identical. The p value is then used to reject this null and accept the
> >> alternative, that they are indeed different.
> >>
> >> Practically we're actually asking if we have enough information to indeed
> >> say they are different.
> >>
> >> I do agree though that stopping there is a bit silly. If there is a
> >> statistical difference then we next need to look at the effect size or in
> >> other words the magnitude of the difference and decide if this is
> >> ecologically meaningful.
> >>
> >>
> >> Chris Howden B.Sc. (Hons) GStat.
> >> Founding Partner
> >> Evidence Based Strategic Development, IP Commercialisation and Innovation,
> >> Data Analysis, Modelling and Training
> >> (mobile) 0410 689 945
> >> (fax) +612 4782 9023
> >> chris at trickysolutions.com.au
> >>
> >>
> >>
> >>
> >> Disclaimer: The information in this email and any attachments to it are
> >> confidential and may contain legally privileged information. If you are
> >> not the named or intended recipient, please delete this communication and
> >> contact us immediately. Please note you are not authorised to copy, use or
> >> disclose this communication or any attachments without our consent.
> >> Although this email has been checked by anti-virus software, there is a
> >> risk that email messages may be corrupted or infected by viruses or other
> >> interferences. No responsibility is accepted for such interference. Unless
> >> expressly stated, the views of the writer are not those of the company.
> >> Tricky Solutions always does our best to provide accurate forecasts and
> >> analyses based on the data supplied, however it is possible that some
> >> important predictors were not included in the data sent to us. Information
> >> provided by us should not be solely relied upon when making decisions and
> >> clients should use their own judgement.
> >>
> >>
> >> -----Original Message-----
> >> From: r-sig-ecology-bounces at r-project.org
> >> [mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of David Valentim
> >> Dias
> >> Sent: Thursday, 26 April 2012 2:36 PM
> >> To: r-sig-ecology at r-project.org
> >> Subject: Re: [R-sig-eco] Testing difference between diversity indices with
> >> vegan::oecosimu
> >>
> >> Hello Cichini,
> >>
> >> I cannot help with your code but seems like you have a silly hypothesis.
> >> Think about it: Probability of two communities to be identical?
> >> You need to restate it in some more useful way. We already know most
> >> things are different but with what magnitude? Which factors are causing
> >> these changes? How these changes matter from the environment and us?
> >>
> >> 2012/4/25 Chris Howden <chris at trickysolutions.com.au>
> >>
> >> > Why not try some type of ANOVA style glm?
> >> >
> >> > Chris Howden
> >> > Founding Partner
> >> > Tricky Solutions
> >> > Tricky Solutions 4 Tricky Problems
> >> > Evidence Based Strategic Development, IP Commercialisation and
> >> > Innovation, Data Analysis, Modelling and Training
> >> >
> >> > (mobile) 0410 689 945
> >> > (fax / office)
> >> > chris at trickysolutions.com.au
> >> >
> >> > Disclaimer: The information in this email and any attachments to it
> >> > are confidential and may contain legally privileged information. If
> >> > you are not the named or intended recipient, please delete this
> >> > communication and contact us immediately. Please note you are not
> >> > authorised to copy, use or disclose this communication or any
> >> > attachments without our consent. Although this email has been checked
> >> > by anti-virus software, there is a risk that email messages may be
> >> > corrupted or infected by viruses or other interferences. No
> >> > responsibility is accepted for such interference. Unless expressly
> >> > stated, the views of the writer are not those of the company. Tricky
> >> > Solutions always does our best to provide accurate forecasts and
> >> > analyses based on the data supplied, however it is possible that some
> >> > important predictors were not included in the data sent to us.
> >> > Information provided by us should not be solely relied upon when
> >> > making decisions and clients should use their own judgement.
> >> >
> >> > On 26/04/2012, at 7:19, Kay Cichini <kay.cichini at gmail.com> wrote:
> >> >
> >> > > 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]]
> >> > >
> >> > > _______________________________________________
> >> > > R-sig-ecology mailing list
> >> > > R-sig-ecology at r-project.org
> >> > > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >> >
> >> > _______________________________________________
> >> > R-sig-ecology mailing list
> >> > R-sig-ecology at r-project.org
> >> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >> >
> >>
> >>
> >>
> >> --
> >> Currmculo: http://lattes.cnpq.br/7541377569511492
> >>
> >>        [[alternative HTML version deleted]]
> >>
> >> _______________________________________________
> >> R-sig-ecology mailing list
> >> R-sig-ecology at r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> >>
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-ecology mailing list