mdine: Microbiome differential network estimation

Description Usage Arguments Details Value References Examples

View source: R/mdine.R

Description

Microbiome differential network estimation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mdine(
  Y,
  X,
  Z,
  lambda = NULL,
  offset = NULL,
  mc.cores = chains,
  iter = 1000,
  chains = 4,
  quant = c(0.025, 0.975),
  nnet.MaxNWts = NULL,
  ...
)

Arguments

Y

The (unrarefied) taxa count matrix with rows as samples and columns as taxa. The last column is the reference category, and is not included in the estimated network.

X

The model matrix (including an intercept column)

Z

Vector containing the binary variable over which the network is assumed to vary.

lambda

Network penalization parameter. If NULL, then lambda is estimated

offset

A vector containing an offset term for each subject

mc.cores

The number of cores to run MCMC chains in parallel

iter

The number of MCMC iterations. By default the first half of the iterations will be used as warmup.

chains

The number of MCMC chains.

quant

Vector containing the lower and upper quantiles of the posterior distribution to create credible intervals.

nnet.MaxNWts

Numeric specifying the maximum number of weights in the nnet::multinom call. This might need to be increased for a large number of OTUs. Defaults to 1000.

...

Other arguments passed to rstan::sampling

Details

MDiNE is a model based on multinomial logistic regression to estimate precision matrix-based networks within two groups.

Value

An object of class mdine containing posterior means for the model parameters, credible intervals, and the stanfit object.

stan.fit

The object returned from rstan. This can be used for MCMC diagnostics provided in the rstan package

post_mean

List contatining estimated posterior means for the model parameters

ci

List contatining credible intervals for all parameters

lam_mle

Initial value of lambda used as mean in the prior distribution for lambda

References

McGregor, Labbe, and Greenwood 2019: DOI

Examples

1
2
3
4
5
library(mdine)
data(crohns)

X <- model.matrix(~disease, data=crohns$covars)
md.fit <- mdine(Y=crohns$otu.counts, X=X, Z=X[,2], mc.cores=1, iter=1000)

kevinmcgregor/mdine documentation built on April 10, 2021, 4:18 a.m.