MGLMdtmTune | R Documentation |
Finds the tuning parameter value that yields the smallest BIC for the Dirichlet-tree multinomial (DTM) sparse regression.
MGLMdtmTune(otu.tab, X, tree, penalty = "sweep", ngridpt = 20)
otu.tab |
a data frame or matrix containing the count data. Rows of the matrix represent observations and columns are the taxa. |
X |
a data frame or matrix containing the covariates. Rows of the matrix represent observations. |
tree |
the phylogenetic tree. |
penalty |
penalty type for the regularization term. Can be chosen from 'sweep', 'group', or 'nuclear'. See Details for the description of each penalty type of MGLM. |
ngridpt |
an optional numeric variable specifying the number of grid points to tune. see MGLMtune. |
Returns a list of MGLM objects ('MGLMtune') corresponding to internal nodes of the tree.
Wang, T., Zhao, H.: A Dirichlet-tree multinomial regression model for associating dietary nutrients with gut microorganisms. Biometrics 73(3), 792–801 (2017).
library(phyloseq) library(magrittr) otu.tab <- t(otu_table(combo.phyloseq.obj)) metadata <- sample_data(combo.phyloseq.obj) tree <- phy_tree(combo.phyloseq.obj) X <- as.matrix(metadata)[,18:37] %>% apply(., 2, as.numeric) # fit <- MGLMdtmTune(otu.tab, X, tree, penalty = "sweep") # Extract_logL(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.