Description Usage Arguments Details Value References Examples
View source: R/micro_rank_sum.R
Runs a rank sum test for each taxa within an OTU table or each taxa that didn't converge in mods
1 | micro_rank_sum(micro_set, table, grp_var, y = ra, mod = NULL, ...)
|
micro_set |
A tidy_micro data set |
table |
OTU table of interest |
grp_var |
A factor variable for grouping |
y |
A continuous response variable. Taxa relative abundance (ra) is recommended |
mod |
The output from |
... |
Options to be passed to |
The grp_var must have a least 2 levels. For a 2 level factor a Mann-Whitney test will be calculated through wilcox.test
, and for 3 or more levels a Kruskal-Wallis test will be run throuh kruskal.test
A data frame containing the p-value for each taxa's rank sum test.
kruskal.test
and wilcox.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(phy); data(cla); data(ord); data(fam); data(met)
otu_tabs = list(Phylum = phy, Class = cla, Order = ord, Family = fam)
set <- tidy_micro(otu_tabs = otu_tabs, meta = met) %>%
filter(day == 7) \
mutate(bpd1 = factor(bpd1))
## Rank sum test on every taxa's relative abundance
set \
## Rank sum test on every taxa whose model didn't converge
set \
nb_mods(table = "Family", bpd1) \
micro_rank_sum(table = "Family", grp_var = bpd1, mod = nb_fam)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.