X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FSlowinskiGuyer.R;h=b0fc956a54163e20ab2f3c62d0b1708f98852d89;hb=1df144a18356d9b329324324bc2f78cfdf1cea3d;hp=1563f02626fef999b9dcbb62d653e71d6e48faa8;hpb=b0548f80b3ac1d2035ddc360d3366eab4f08d247;p=ape.git diff --git a/R/SlowinskiGuyer.R b/R/SlowinskiGuyer.R index 1563f02..b0fc956 100644 --- a/R/SlowinskiGuyer.R +++ b/R/SlowinskiGuyer.R @@ -1,4 +1,4 @@ -## SlowinskiGuyer.R (2011-03-10) +## SlowinskiGuyer.R (2011-05-05) ## Tests of Diversification Shifts with Sister-Clades @@ -65,7 +65,8 @@ richness.yule.test <- function(x, t) diversity.contrast.test <- function(x, method = "ratiolog", alternative = "two.sided", nrep = 0, ...) { - method <- match.arg(method, c("ratiolog", "proportion", "difference")) + method <- match.arg(method, c("ratiolog", "proportion", + "difference", "logratio")) alternative <- match.arg(alternative, c("two.sided", "less", "greater")) minmax <- t(apply(x, 1, sort)) # sort all rows @@ -81,7 +82,8 @@ diversity.contrast.test <- log(minmax[, 2]) / log(minmax[, 1]) }, "proportion" = minmax[, 2] / (minmax[, 2] + minmax[, 1]), - "difference" = abs(DIFF)) + "difference" = abs(DIFF), + "logratio" = log(minmax[, 1] / minmax[, 2])) y <- SIGN * CONTRAST # the signed contrasts