\Header{p.adjust}{Adjust p values for multiple comparisons}
\methalias{p.adjust.methods}{p.adjust}
\keyword{htest}{p.adjust}
\begin{Description}\relax
Given a set of p values, returns p values adjusted using one of
several methods.\end{Description}
\begin{Usage}
\begin{verbatim}
p.adjust(p, method=p.adjust.methods, n=length(p))
p.adjust.methods # c("holm", "hochberg", "bonferroni","none")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{p}] vector of p values
\item[\code{method}] correction method
\item[\code{n}] number of comparisons
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The adjustment methods include the Bonferroni correction in
which the p values are multiplied by the number of comparisons. Two
less conservative corrections by Holm, respectively Hochberg,
are also included. A pass-through option \code{"none"} is also
included. The set of methods are contained in the
\code{p.adjust.methods} vector for the benefit of methods that need to
have the method as an option and pass it on to \code{p.adjust}.\end{Details}
\begin{Value}
A vector of corrected p values.\end{Value}
\begin{Note}\relax
The Hochberg method is only proved to work if the p values are
independent, although simulations have indicated that it works in
correlated cases as well. Hence the Holm method is the default.\end{Note}
\begin{References}\relax
S Paul Wright: Adjusted P-values for simultaneous
inference,  Biometrics \bold{48}, 1005--1013\end{References}
\begin{SeeAlso}\relax
\code{pairwise.*} functions in the \code{ctest} package, such
as \code{\Link{pairwise.t.test}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  p <- runif(50)
  p.adjust(p)
\end{ExampleCode}
\end{Examples}

