\HeaderA{auROC}{Area Under Receiver Operating Curve}{auROC}
\keyword{htest}{auROC}
\begin{Description}\relax
Compute exact area under the ROC for empirical data.
\end{Description}
\begin{Usage}
\begin{verbatim}
auROC(truth, stat)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{truth}] numeric vector of 0 and 1 indicating whether the null or alternative respectively is true for each case.
If \code{stat} is missing then \code{truth} is assuming to be already sorted in decreasing test statistic order.
\item[\code{stat}] numeric vector containing test statistics.
Hypotheses are to be rejected if \code{stat} exceeds a given threshold.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function computes the exact area under an empirical ROC curve.
The number of true and false discoveries are determined by how well the true states represented by \code{truth} match up with the observed statistics given by \code{stat}.
\end{Details}
\begin{Value}
Numeric vector giving area under the curve, 1 being perfect and 0 being the minimum, or \code{NULL} if \code{truth} has zero length.
\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
See \LinkA{08.Tests}{08.Tests} for other functions for testing and processing p-values.

See also \code{\LinkA{AUC}{AUC}} in the \code{ROC} package.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
auROC(c(1,1,0,0,0))
truth <- rbinom(30,size=1,prob=0.2)
stat <- rchisq(30,df=2)
auROC(truth,stat)
\end{ExampleCode}
\end{Examples}

