\HeaderA{stat.gnames}{Sort Genes According to the Value of a Statistic}{stat.gnames}
\keyword{misc}{stat.gnames}
\begin{Description}\relax
Lists genes and corresponding statistics in decreasing order of the
statistics. This function applies to any type of statistic, including
log ratios, one and two-sample t-statistics, and F-statistics. Missing
values are ignored, as in \code{\LinkA{sort}{sort}(..., na.last=NA)}.
\end{Description}
\begin{Usage}
\begin{verbatim}
stat.gnames(x, gnames, crit= 50)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a numeric vector containing the statistics for each
gene. Missing values (NAs) are allowed. 
\item[\code{gnames}] a character vector containing the gene names.
\item[\code{crit}] specifies the number of genes to be returned. If crit <
1, the crit*100\% genes with the largest x values are listed. If crit
>= 1, the crit genes with the largest x values are listed. 
\end{ldescription}
\end{Arguments}
\begin{Value}
List containing the following components 
\begin{ldescription}
\item[\code{gnames}] gene names sorted in decreasing order of the
statistics in x.
\item[\code{t}] statistics sorted in decreasing order.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Yee Hwa Yang, \email{yeehwa@stat.berkeley.edu} \\
Sandrine Dudoit, \email{sandrine@stat.berkeley.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{order}{order}}, \code{\LinkA{sort}{sort}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(swirl)
aveM <- apply(maM(swirl), 1, mean.na)
Gnames <- maGeneTable(swirl)

stat.gnames(abs(aveM), Gnames, crit=10)
stat.gnames(aveM, Gnames, crit=0.01)

\end{ExampleCode}
\end{Examples}


