\HeaderA{comp.ebayes}{Computing Empirical Bayes Statistics for Differential Expression}{comp.ebayes}
\keyword{htest}{comp.ebayes}
\begin{Description}\relax
\code{comp.ebayes} returns a function of one argument with bindings for
\code{L} and \code{proportion}. This function accepts a microarray
data matrix as its single argment, when evaluated, computes lod-odds
(B statistics) and moderated t statistics of differential expression
by emprical Bayes shrinkage of the standard error toward a common value.
\end{Description}
\begin{Usage}
\begin{verbatim}
comp.ebayes(L = NULL, proportion = 0.01)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{L}] A vector of integers corresponding to observation (column)
class labels. For \eqn{k}{} classes, the labels must be integers
between 0 and \eqn{k-1}{}.
\item[\code{proportion}] A numeric variable specifying the proportion of
differential expression.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function returned by \code{comp.ebayes} calculates B statistics
and moderated t statistics for each row of the microarray data
matrix, with bindings for \code{L} and \code{proportion}. It
interfaces to a C function.
\end{Details}
\begin{Value}
\code{comp.ebayes} returns a function (F) with the bindings for
\code{L} and \code{proportion} . The function F when supplied with
a microarray data matrix and evaluated will return a matrix of two
columns:
\begin{ldescription}
\item[\code{t}] Moderated t statistics
\item[\code{B}] B statistics (log-odds) of differential expression
\end{ldescription}
\end{Value}
\begin{Author}\relax
Yuanyuan Xiao, \email{yxiao@itsa.ucsf.edu}, \\
Jean Yee Hwa Yang, \email{jean@biostat.ucsf.edu}.
\end{Author}
\begin{References}\relax
Lönnstedt, I. and Speed, T. P. (2002). Replicated microarray
data. \emph{Statistica Sinica} \bold{12}, 31-46.

Smyth, G. K. (2003). Linear models and empirical Bayes methods for
assessing differential expression in microarray
experiments. http://www.statsci.org/smyth/pubs/ebayes.pdf
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{comp.modt}{comp.modt}},\code{\LinkA{comp.B}{comp.B}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
X <- matrix(rnorm(1000,0,0.5), nc=10)
L <- rep(0:1,c(5,5))

# genes 1-10 are differentially expressed
X[1:10,6:10]<-X[1:10,6:10]+1

# compute B and moderated t statistics, proportion set as 0.01
ebayes.fun <- comp.ebayes(L)
ebayes.X <- ebayes.fun(X)

# compute B and moderated t statistics, proportion set as 0.1
ebayes.fun <- comp.ebayes(L, proportion=0.1)
ebayes.X <- ebayes.fun(X)

\end{ExampleCode}
\end{Examples}

