[Vegan-commits] r891 - in pkg/vegan: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 13 04:20:23 CEST 2009


Author: psolymos
Date: 2009-07-13 04:20:23 +0200 (Mon, 13 Jul 2009)
New Revision: 891

Modified:
   pkg/vegan/R/dispindmorisita.R
   pkg/vegan/man/dispindmorisita.Rd
Log:
lower.tail=FALSE used to be in line with Chi2 quantiles in Krebs

Modified: pkg/vegan/R/dispindmorisita.R
===================================================================
--- pkg/vegan/R/dispindmorisita.R	2009-07-12 14:01:23 UTC (rev 890)
+++ pkg/vegan/R/dispindmorisita.R	2009-07-13 02:20:23 UTC (rev 891)
@@ -7,9 +7,9 @@
     Imor <- numeric(p)
     Imor <- apply(x, 2, function(y) n * ((sum(y^2) - sum(y)) / (sum(y)^2 - sum(y))))
     Smor <- Imor
-    chicr <- qchisq(c(0+crit/2, 1-crit/2), n-1)
-    Muni <- apply(x, 2, function(y) (chicr[1] - n + sum(y)) / (sum(y) - 1))
-    Mclu <- apply(x, 2, function(y) (chicr[2] - n + sum(y)) / (sum(y) - 1))
+    chicr <- qchisq(c(0+crit/2, 1-crit/2), n-1, lower.tail=FALSE)
+    Muni <- apply(x, 2, function(y) (chicr[2] - n + sum(y)) / (sum(y) - 1))
+    Mclu <- apply(x, 2, function(y) (chicr[1] - n + sum(y)) / (sum(y) - 1))
     for (i in 1:p) {
         if (apply(x, 2, sum)[i] > 1) {
             if (Imor[i] >= Mclu[i] && Mclu[i] > 1)

Modified: pkg/vegan/man/dispindmorisita.Rd
===================================================================
--- pkg/vegan/man/dispindmorisita.Rd	2009-07-12 14:01:23 UTC (rev 890)
+++ pkg/vegan/man/dispindmorisita.Rd	2009-07-13 02:20:23 UTC (rev 891)
@@ -34,9 +34,9 @@
 values of the Chi-squared distribution with \eqn{n-1} degrees of
 freedom, respectively, for \code{alpha = 0.05}):
 
-\code{Mclu = (Chi2Upper - n + sum(xi)) / (sum(xi) - 1)}
+\code{Mclu = (Chi2Lower - n + sum(xi)) / (sum(xi) - 1)}
 
-\code{Muni = (Chi2Lower - n + sum(xi)) / (sum(xi) - 1)}
+\code{Muni = (Chi2Upper - n + sum(xi)) / (sum(xi) - 1)}
 
 Smith-Gill (1975) proposed scaling of Morisita index from [0, n]
 interval into [-1, 1], and setting up -0.5 and 0.5 values as



More information about the Vegan-commits mailing list