View source: R/BetweenGroup.test.R
BetweenGroup.test | R Documentation |
It runs standard univarate statistical tests (such as t.test, wilcox.test, oneway.test, kruskal.test) for all variates (columns) in the data.frame/data.matrix.
BetweenGroup.test(
x,
y,
clr_transform = FALSE,
p.adj.method = "bonferroni",
positive_class = NA,
q_cutoff = 0.2,
paired = FALSE
)
x |
A data.martrix or data.frame including multiple numeric vectors. |
y |
A factor with two or more levels. |
clr_transform |
A logical value indicates if clr transformation before statistical analysis of compositional microbiome data. |
p.adj.method |
A string indicating the p-value correction method. |
positive_class |
A string indicating the specified class in the factor y. |
q_cutoff |
A number indicating the cutoff of q values after fdr correction. |
paired |
A logical indicating if paired between-group comparison is desired. |
...
Shi Huang
clr, t.test, wilcox.test, oneway.test, kruskal.test
x0 <- data.frame(t(rmultinom(16,160,c(.001,.5,.3,.3,.299))) + 0.65)
x <- data.frame(rbind(t(rmultinom(7, 75, c(.201,.5,.02,.18,.099))),
t(rmultinom(8, 75, c(.201,.4,.12,.18,.099))),
t(rmultinom(15, 75, c(.011,.3,.22,.18,.289))),
t(rmultinom(15, 75, c(.091,.2,.32,.18,.209))),
t(rmultinom(15, 75, c(.001,.1,.42,.18,.299)))))
# clr_x<-compositions::clr(x)
y<-factor(c(rep("A", 30), rep("B", 30)))
y1<-factor(c(rep("A", 15), rep("B", 15), rep("C", 15), rep("D", 15)))
system.time(BetweenGroup.test(x, y, clr_transform=FALSE))
system.time(BetweenGroup.test(x, y, clr_transform=TRUE))
system.time(BetweenGroup.test(x, y1, clr_transform=TRUE))
x_ <- data.frame(rbind(t(rmultinom(7, 7500, rep(c(.201,.5,.02,.18,.099), 100))),
t(rmultinom(8, 7500, rep(c(.201,.4,.12,.18,.099), 100))),
t(rmultinom(15, 7500, rep(c(.011,.3,.22,.18,.289), 100))),
t(rmultinom(15, 7500, rep(c(.091,.2,.32,.18,.209), 100))),
t(rmultinom(15, 7500, rep(c(.001,.1,.42,.18,.299), 100)))))
y_<-factor(c(rep("A", 30), rep("B", 30)))
y_1<-factor(c(rep("A", 15), rep("B", 15), rep("C", 15), rep("D", 15)))
system.time(BetweenGroup.test(x_, y_))
system.time(BetweenGroup.test(x_, y_1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.