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

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")
#>                confounder pseudo_F pvalue
#> 1 ReportedAntibioticUsage 1.193135  0.255