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 `nb_mods`

or `bb_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(bpd_cla); data(bpd_clin)
set <- tidy_micro(otu_tabs = bpd_cla, tab_names = "Class", clinical = bpd_clin,
prev_cutoff = 5, ra_cutoff = 0.1, exclude_taxa = c("Unclassified", "Bacteria")) %>%
filter(day == 7) ## Only including the first week
## Rank sum test on every taxa's relative abundance
set %>% micro_rank_sum(table = "Class", grp_var = bpd1)
## Rank sum test on every taxa whose model didn't converge
nb_cla <- nb_mods(set, table = "Class", bpd1)
micro_rank_sum(micro_set = set, table = "Class",
grp_var = bpd1, mod = nb_cla)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.