linda.wald.test: Wald test for bias-corrected regression coefficient

View source: R/linda.R

linda.wald.testR Documentation

Wald test for bias-corrected regression coefficient

Description

The function implements Wald test for bias-corrected regression coefficient learned from the linda function. One can utilize the function to perform ANOVA-type analyses.

Usage

linda.wald.test(
  linda.obj,
  L,
  model = c("LM", "LMM"),
  alpha = 0.05,
  p.adj.method = "BH"
)

Arguments

linda.obj

return from the linda function.

L

A matrix for testing Lb = 0, where b includes the intercept and all fixed effects. Thus the number of columns of L must be equal to length(variables)+1, where variables is from linda.obj, which does not include the intercept.

model

'LM' or 'LMM' indicating the model fitted in {linda} is linear model or linear mixed-effect model.

alpha

significance level for testing Lb = 0.

p.adj.method

P-value adjusting approach. See R function p.adjust. The default is 'BH'.

Value

A data frame with columns

Fstat

Wald statistics for each taxon

df1

The numerator degrees of freedom

df2

The denominator degrees of freedom

pvalue

1 - pf(Fstat, df1, df2)

padj

p.adjust(pvalue, method = p.adj.method)

reject

padj <= alpha

Author(s)

Huijuan Zhou huijuanzhou2019@gmail.com Jun Chen Chen.Jun2@mayo.edu Xianyang Zhang zhangxiany@stat.tamu.edu

References

Huijuan Zhou, Kejun He, Jun Chen, and Xianyang Zhang. LinDA: Linear Models for Differential Abundance Analysis of Microbiome Compositional Data.

Examples


#install package "phyloseq" for importing "smokers" dataset
ind <- smokers$meta$AIRWAYSITE == 'Throat'
otu.tab <- as.data.frame(smokers$otu[, ind])
meta <- cbind.data.frame(Smoke = factor(smokers$meta$SMOKER[ind]),
                         Sex = factor(smokers$meta$SEX[ind]),
                         Site = factor(smokers$meta$SIDEOFBODY[ind]),
                         SubjectID = factor(smokers$meta$HOST_SUBJECT_ID[ind]))
linda.obj <- linda(otu.tab, meta, formula = '~Smoke+Sex+(1|SubjectID)+(Smoke|Site)', alpha = 0.1,
                   prev.cut = 0.1, lib.cut = 1000, winsor.quan = 0.97)
L <- matrix(c(0, 1, 0, 0, 0, 1), nrow = 2, byrow = TRUE)
result <- linda.wald.test(linda.obj, L, 'LMM', alpha = 0.1)


zhouhj1994/LinDA documentation built on Jan. 30, 2024, 5:54 p.m.