Description Usage Arguments Details Value References Examples

Run Chi-Squared tests for presence / absence of each taxa in you data set, or each taxa that didn't converge in negative binomial models

1 | ```
micro_chisq(micro_set, table, grp_var, y = bin, mod = NULL, ...)
``` |

`micro_set` |
A tidy_micro data set |

`table` |
The OTU table you'd like to test |

`grp_var` |
Grouping variable for chi-squared test |

`y` |
Response variable for chi-squared test. Default is presence / absence (bin) |

`mod` |
The output from mods if you'd like to only run on taxa that did not converge |

`...` |
Options to be passed to chisq.test |

If the taxa are present or absent in every subject the chi-sqared test will not but run. The returned chi-sqared stat will either be "All Absent" or "All Present." This will be clear in the output

A data from containing the taxa, the chi-squared statistic, and the p-value of the test.

`help(chisq.test)`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
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
## Chi-squared test on every taxa's presence/absence
set %>% micro_chisq(table = "Class", grp_var = bpd1,
simulate.p.value = TRUE)
## Chi-squared test on every taxa whose model didn't converge
nb_cla <- set %>% nb_mods(table = "Class", bpd1)
micro_chisq(micro_set = set, table = "Class", grp_var = bpd1,
mod = nb_cla, simulate.p.value = TRUE)
``` |

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.