[Vegan-commits] r1115 - in branches/1.17: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 11 15:47:30 CET 2010


Author: jarioksa
Date: 2010-01-11 15:47:30 +0100 (Mon, 11 Jan 2010)
New Revision: 1115

Modified:
   branches/1.17/R/betadisper.R
   branches/1.17/inst/ChangeLog
   branches/1.17/man/betadisper.Rd
Log:
merge betadisper updates (r1096, r1114) to branches/1.17

Modified: branches/1.17/R/betadisper.R
===================================================================
--- branches/1.17/R/betadisper.R	2010-01-11 09:31:41 UTC (rev 1114)
+++ branches/1.17/R/betadisper.R	2010-01-11 14:47:30 UTC (rev 1115)
@@ -1,11 +1,13 @@
 `betadisper` <-
-    function(d, group, type = c("centroid","median"))
+    function(d, group, type = c("median","centroid"))
 {
     ## Tolerance for zero Eigenvalues
     TOL <- 1e-7
     ## uses code from stats:::cmdscale by R Core Development Team
     if(!inherits(d, "dist"))
         stop("distances 'd' must be a 'dist' object")
+    if(missing(type))
+        type <- "median"
     type <- match.arg(type)
     ## checks for groups - need to be a factor for later
     if(!is.factor(group))

Modified: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2010-01-11 09:31:41 UTC (rev 1114)
+++ branches/1.17/inst/ChangeLog	2010-01-11 14:47:30 UTC (rev 1115)
@@ -14,6 +14,8 @@
 
 	* removed multipart.
 
+	* merged betadisper updates (rev1096 & 1114). 
+
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
 Version 1.16-34 (closed January 2, 2010) -- (codename: Lucia)

Modified: branches/1.17/man/betadisper.Rd
===================================================================
--- branches/1.17/man/betadisper.Rd	2010-01-11 09:31:41 UTC (rev 1114)
+++ branches/1.17/man/betadisper.Rd	2010-01-11 14:47:30 UTC (rev 1115)
@@ -26,7 +26,7 @@
   Tukey's 'Honest Significant Difference' method.
 }
 \usage{
-betadisper(d, group, type = c("centroid","median"))
+betadisper(d, group, type = c("median","centroid"))
 
 \method{anova}{betadisper}(object, \dots)
 
@@ -51,7 +51,7 @@
     \code{\link[base]{as.factor}}. Can consist of a factor with a single
     level (i.e.~one group).}
   \item{type}{the type of analysis to perform. Use the spatial median or
-  the group centroid?}
+  the group centroid? The spatial median is now the default.}
   \item{display}{character; partial match to access scores for
     \code{"sites"} or \code{"species"}.}
   \item{object, x}{an object of class \code{"betadisper"}, the result of a
@@ -73,7 +73,8 @@
 \details{
   One measure of multivariate dispersion (variance) for a group of
   samples is to calculate the average distance of group members to the
-  group centroid or spatial median in multivariate space. To test if the
+  group centroid or spatial median (both referred to as 'centroid' from
+  now on unless stated otherwise) in multivariate space. To test if the
   dispersions (variances) of one or more groups are different, the
   distances of group members to the group centroid are subject to
   ANOVA. This is a multivariate analogue of Levene's test for
@@ -175,6 +176,14 @@
   Missing values in either \code{d} or \code{group} will be removed
   prior to performing the analysis.
 }
+\section{Warning}{
+  Stewart Schultz noticed that the permutation test for \code{type =
+  "centroid"} had the wrong type I error and was anti-conservative. As
+  such, the default for \code{type} has been changed to \code{"median"},
+  which uses the spatial median as the group centroid. Tests suggests
+  that the permutation test for this type of analysis gives the correct
+  error rates.
+}
 \references{
   Anderson, M.J. (2006) Distance-based tests for homogeneity of
   multivariate dispersions. \emph{Biometrics} \strong{62(1)}, 245--253.



More information about the Vegan-commits mailing list