MGLMdtmSparseReg: Fit the Dirichlet-tree multinomial (DTM) sparse regression.

View source: R/MGLMdtmSparseReg.R

MGLMdtmSparseRegR Documentation

Fit the Dirichlet-tree multinomial (DTM) sparse regression.

Description

Fit the Dirichlet-tree multinomial (DTM) sparse regression.

Usage

MGLMdtmSparseReg(otu.tab, X, tree, penalty = "sweep", lambda = Inf)

Arguments

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.

lambda

penalty parameter.

Value

Returns a list of MGLM objects ('MGLMsparsereg') corresponding to internal nodes of the tree.

References

Wang, T., Zhao, H.: A Dirichlet-tree multinomial regression model for associating dietary nutrients with gut microorganisms. Biometrics 73(3), 792–801 (2017).

Examples

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 <- MGLMdtmSparseReg(otu.tab, X, tree, penalty = 'sweep', lambda = Inf)
Extract_logL(fit)

liudoubletian/phyloMDA documentation built on April 28, 2022, 6:51 p.m.