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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 15 08:01:48 CET 2010


Author: jarioksa
Date: 2010-12-15 08:01:46 +0100 (Wed, 15 Dec 2010)
New Revision: 1423

Modified:
   pkg/vegan/R/mantel.correlog.R
   pkg/vegan/inst/ChangeLog
Log:
fixed treatment of ties in permutations for negative values of the statistic

Modified: pkg/vegan/R/mantel.correlog.R
===================================================================
--- pkg/vegan/R/mantel.correlog.R	2010-12-14 14:32:13 UTC (rev 1422)
+++ pkg/vegan/R/mantel.correlog.R	2010-12-15 07:01:46 UTC (rev 1423)
@@ -100,7 +100,7 @@
                 ## (H1: r>0) Here, compute a one-tailed p-value in
                 ## direction of the sign
                 if(temp$statistic < 0) {
-                    temp.p <- ((1-temp.p)*(nperm+1))/(nperm+1)
+                    temp.p <- (sum(temp$perm <= temp$statistic)+1)/(nperm+1)
                 }
                 mantel.p <- c(mantel.p, temp.p)
             } else {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2010-12-14 14:32:13 UTC (rev 1422)
+++ pkg/vegan/inst/ChangeLog	2010-12-15 07:01:46 UTC (rev 1423)
@@ -4,6 +4,15 @@
 
 Version 1.18-18 (opened December 1, 2010)
 
+	* mantel.correlog: proper treatment of ties in permutation
+	statistics. Function uses mantel() to evaluate p-values, and this
+	uses one-sided test. If the statistic is negative, the test
+	direction is reversed, but then p-value cannot be directly
+	complemented if there are ties: the observed statistic must be
+	switchec to another side of the tied block. Therefore
+	mantel.correlog() now evaluates the p-value directly in reversed
+	test.
+
 	* nestedtemp: updated the literature reference to Almeida-Neto &
 	Ulrich (2011).
 



More information about the Vegan-commits mailing list