confounder: Confounder analysis

View source: R/confounder.R

confounderR Documentation

Confounder analysis

Description

Confounding variables may mask the actual differential features. This function utilizes constrained correspondence analysis (CCA) to measure the confounding factors.

Usage

confounder(
  ps,
  target_var,
  norm = "none",
  confounders = NULL,
  permutations = 999,
  ...
)

Arguments

ps

a phyloseq::phyloseq object.

target_var

character, the variable of interest

norm

norm the methods used to normalize the microbial abundance data. See normalize() for more details.

confounders

the confounding variables to be measured, if NULL, all variables in the meta data will be analyzed.

permutations

the number of permutations, see vegan::anova.cca().

...

extra arguments passed to vegan::anova.cca().

Value

a data.frame contains three variables: confounder, pseudo-F and p value.

Examples

data(caporaso)
confounder(caporaso, "SampleType", confounders = "ReportedAntibioticUsage")


yiluheihei/microbiomeMarker documentation built on Nov. 5, 2023, 7:19 a.m.