\HeaderA{pairwise.t.test}{Pairwise t tests}{pairwise.t.test}
\keyword{htest}{pairwise.t.test}
\begin{Description}\relax
Calculate pairwise comparisons between group levels with corrections
for multiple testing
\end{Description}
\begin{Usage}
\begin{verbatim}
pairwise.t.test(x, g, p.adjust.method = p.adjust.methods,
                pool.sd = !paired, paired = FALSE,
                alternative = c("two.sided", "less", "greater"),  ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] response vector. 
\item[\code{g}] grouping vector or factor. 
\item[\code{p.adjust.method}] Method for adjusting p values (see \code{\LinkA{p.adjust}{p.adjust}}). 
\item[\code{pool.sd}] switch to allow/disallow the use of a pooled SD 
\item[\code{paired}] a logical indicating whether you want paired
t-tests. 
\item[\code{alternative}] a character string specifying the alternative
hypothesis, must be one of \code{"two.sided"} (default),
\code{"greater"} or \code{"less"}.  
\item[\code{...}] additional arguments to pass to \code{t.test}. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{pool.SD} switch calculates a common SD for all
groups and used that for all comparisons (this can be useful if some
groups are small). This method does not actually call \code{t.test},
so extra arguments are ignored. Pooling does not generalize to paired tests
so \code{pool.SD} and \code{paired} cannot both be \code{TRUE}.

Only the lower triangle of the matrix of possible comparisons is being
calculated, so setting \code{alternative} to anything other than
\code{"two.sided"} requires that the levels of \code{g} are ordered
sensibly.
\end{Details}
\begin{Value}
Object of class \code{"pairwise.htest"}
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{t.test}{t.test}}, \code{\LinkA{p.adjust}{p.adjust}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
attach(airquality)
Month <- factor(Month, labels = month.abb[5:9])
pairwise.t.test(Ozone, Month)
pairwise.t.test(Ozone, Month, p.adj = "bonf")
pairwise.t.test(Ozone, Month, pool.sd = FALSE)
detach()
\end{ExampleCode}
\end{Examples}

