micro_alpha_reg: Linear regression on alpha diversities within a micro_set

Description Usage Arguments Value Note Examples

View source: R/micro_alpha_reg.R

Description

A simple wrapper to run standard linear regression though the lm function. Will only use alpha diversities distinct libraries (Lib) from the specified table as to not inflate the sample size

Usage

1
micro_alpha_reg(alpha_set, table, ...)

Arguments

alpha_set

A tidy_micro data set with alpha diversities calculated by alpha_div

table

OTU table of interest

...

Covariates of interest. Can include interaction terms such as Group*Age

Value

A data frame containing the model estimates for each alpha diversity

Note

Be aware of your minimal sequencing depth as this will be the size of all bootstrapped resamples (rarefied).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)

otu_tabs <- list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)
set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including first week


set_fam_alpha <- set %>% alpha_div(table = "Family", min_depth = 5000, min_goods = 90)
set_fam_alpha %>% micro_alpha_reg(table = "Family", bpd1)

tidyMicro documentation built on Jan. 13, 2021, 6:18 a.m.