[Vegan-commits] r2312 - branches/2.0/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Oct 7 12:32:22 CEST 2012
Author: gsimpson
Date: 2012-10-07 12:32:22 +0200 (Sun, 07 Oct 2012)
New Revision: 2312
Modified:
branches/2.0/R/permutest.betadisper.R
Log:
merge r2311 with 2.0 branch
Modified: branches/2.0/R/permutest.betadisper.R
===================================================================
--- branches/2.0/R/permutest.betadisper.R 2012-10-07 10:31:04 UTC (rev 2311)
+++ branches/2.0/R/permutest.betadisper.R 2012-10-07 10:32:22 UTC (rev 2312)
@@ -4,10 +4,10 @@
t.statistic <- function(x, y) {
m <- length(x)
n <- length(y)
- xbar <- mean(x) ## .Internal(mean(x))
- ybar <- mean(y) ## .Internal(mean(y))
- xvar <- var(x) ## .Internal(cov(x, NULL, 1, FALSE))
- yvar <- var(y) ## .Internal(cov(y, NULL, 1, FALSE))
+ xbar <- mean(x)
+ ybar <- mean(y)
+ xvar <- var(x)
+ yvar <- var(y)
pooled <- sqrt(((m-1)*xvar + (n-1)*yvar) / (m+n-2))
(xbar - ybar) / (pooled * sqrt(1/m + 1/n))
}
@@ -33,7 +33,6 @@
x$distances[x$group == z[2]])})
}
for(i in seq(along = res[-1])) {
- ##perm <- permuted.index2(nobs, control = control)
perm <- shuffle(nobs, control = control)
perm.resid <- resids[perm]
f <- qr.fitted(mod.Q, perm.resid)
More information about the Vegan-commits
mailing list