[Vegan-commits] r757 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 25 09:50:34 CET 2009


Author: jarioksa
Date: 2009-03-25 09:50:34 +0100 (Wed, 25 Mar 2009)
New Revision: 757

Modified:
   pkg/vegan/R/mrpp.R
   pkg/vegan/inst/ChangeLog
Log:
mrpp: expected delta is now the mean of original dissimilarities instead of mean of permutation deltas

Modified: pkg/vegan/R/mrpp.R
===================================================================
--- pkg/vegan/R/mrpp.R	2009-03-25 08:44:48 UTC (rev 756)
+++ pkg/vegan/R/mrpp.R	2009-03-25 08:50:34 UTC (rev 757)
@@ -29,9 +29,10 @@
     classdel <- classmean(ind, dmat, indls)
     names(classdel) <- names(ncl) <- levels(grouping)[indls]
     del <- weighted.mean(classdel, w = w, na.rm = TRUE)
+    E.del <- mean(dmat, na.rm = TRUE)
     ## 'Classification strength' if weight.type == 3
     if (weight.type == 3) {
-        CS <- N*(N-1)/2*(mean(dmat, na.rm = TRUE) - del)/(N*(N-1)/2 - sum(w))
+        CS <- N*(N-1)/2*(E.del - del)/(N*(N-1)/2 - sum(w))
     } else {
         CS <- NA
     }
@@ -42,7 +43,6 @@
     m.ds <- numeric(permutations)
     m.ds <- apply(perms, 2, function(x) mrpp.perms(x, dmat, indls, 
         w))
-    E.del <- mean(m.ds)
     p <- (1 + sum(del >= m.ds))/(permutations + 1)
     r2 <- 1 - del/E.del
     out <- list(call = match.call(), delta = del, E.delta = E.del, CS = CS,

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-03-25 08:44:48 UTC (rev 756)
+++ pkg/vegan/inst/ChangeLog	2009-03-25 08:50:34 UTC (rev 757)
@@ -4,9 +4,10 @@
 
 Version 1.16-16 (openen Mar 25, 2009)
 
-	* mrpp: reports now "classification strength" when weight.type =
-	3 or weights n*(n-1) are used. Returns mean dissimilarities and
-	counts for classes. 
+	* mrpp: reports now "classification strength" when weight.type = 3
+	or weights n*(n-1) are used. Returns mean dissimilarities and
+	counts for classes. Expected delta is now the mean of original
+	dissimilarities instead of mean of permutation deltas.
 
 Version 1.16-15 (closed Mar 25, 2009)
 



More information about the Vegan-commits mailing list