MMiRKAT: Multivariate Microbiome Regression-based Kernel Association...

View source: R/MMiRKAT.R

MMiRKATR Documentation

Multivariate Microbiome Regression-based Kernel Association Test

Description

Test for association between overall microbiome composition and multiple continuous outcomes.

Usage

MMiRKAT(Y, X = NULL, Ks, returnKRV = FALSE, returnR2 = FALSE)

Arguments

Y

A numerical n by p matrix of p continuous outcome variables, n being sample size.

X

A numerical n by q matrix or data frame, containing q additional covariates that you want to adjust for (Default = NULL). If it is NULL, an intercept only model is fit.

Ks

A list of numerical n by n kernel matrices, or a single n by n kernel matrix, where n is the sample size. Kernels can be constructed from distance matrices (such as Bray-Curtis or UniFrac distances) using the function D2K, or through other mathematical approaches.

returnKRV

A logical indicating whether to return the KRV statistic. Defaults to FALSE.

returnR2

A logical indicating whether to return the R-squared coefficient. Defaults to FALSE.

Details

Missing data is not permitted. Please remove all individuals with missing Y, X, K prior to analysis

The method of generating kernel specific p-values is "davies", which represents an exact method that computes the p-value by inverting the characteristic function of the mixture chisq.

Value

Returns a list of the MMiRKAT p-values for each inputted kernel matrix, labeled with the names of the kernels, if given.

p_values

list of the p-values for each individual kernel matrix inputted

KRV

A vector of kernel RV statistics (a measure of effect size), one for each candidate kernel matrix. Only returned if returnKRV = TRUE

R2

A vector of R-squared statistics, one for each candidate kernel matrix. Only returned if returnR2 = TRUE

Author(s)

Nehemiah Wilson, Haotian Zheng, Xiang Zhan, Ni Zhao

References

Zheng, H., Zhan, X., Tong, X., Zhao, N., Maity,A., Wu, M.C., and Chen,J. A small-sample multivariate kernel machine test for microbiome association studies. Genetic Epidemiology, 41(3), 210-220. DOI: 10.1002/gepi.22030

Examples

 
library(GUniFrac)
if(requireNamespace("vegan")) { library(vegan) }

data(throat.tree)
data(throat.otu.tab)
data(throat.meta)

unifracs <- GUniFrac(throat.otu.tab, throat.tree, alpha=c(0, 0.5, 1))$unifracs

if(requireNamespace("vegan")) {
 BC= as.matrix(vegdist(throat.otu.tab , method="bray"))
 Ds = list(w = unifracs[,,"d_1"], u = unifracs[,,"d_UW"], BC = BC) 
} else {
 Ds = list(w = unifracs[,,"d_1"], u = unifracs[,,"d_UW"]) 
}
Ks = lapply(Ds, FUN = function(d) D2K(d)) 

n = nrow(throat.otu.tab)
Y = matrix(rnorm(n*3, 0, 1), n, 3)

covar = cbind(as.numeric(throat.meta$Sex == "Male"), as.numeric(throat.meta$PackYears))
MMiRKAT(Y = Y, X = covar, Ks = Ks) 


MiRKAT documentation built on March 7, 2023, 5:55 p.m.