% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/confounder.R
\name{confounder}
\alias{confounder}
\title{Confounder analysis}
\usage{
confounder(
  ps,
  target_var,
  norm = "none",
  confounders = NULL,
  permutations = 999,
  ...
)
}
\arguments{
\item{ps}{a \code{\link[phyloseq:phyloseq-class]{phyloseq::phyloseq}} object.}

\item{target_var}{character, the variable of interest}

\item{norm}{norm the methods used to normalize the microbial abundance data. See
\code{\link[=normalize]{normalize()}} for more details.}

\item{confounders}{the confounding variables to be measured, if \code{NULL}, all
variables in the meta data will be analyzed.}

\item{permutations}{the number of permutations, see \code{\link[vegan:anova.cca]{vegan::anova.cca()}}.}

\item{...}{extra arguments passed to \code{\link[vegan:anova.cca]{vegan::anova.cca()}}.}
}
\value{
a \code{data.frame} contains three variables: confounder,
pseudo-F and p value.
}
\description{
Confounding variables may mask the actual differential features. This
function utilizes constrained correspondence analysis (CCA) to measure the
confounding factors.
}
\examples{
data(caporaso)
confounder(caporaso, "SampleType", confounders = "ReportedAntibioticUsage")

}
