\HeaderA{comp.t}{Computing One and Two Sample t-statistic for Differential Expression}{comp.t}
\keyword{univar}{comp.t}
\begin{Description}\relax
\code{comp.t} returns a function of one argument with bindings for
\code{L}, \code{mu}, \code{var.equal}. This function accepts a
microarray data matrix as its single argment, when evaluated, computes
t statistics for each row of the matrix.
\end{Description}
\begin{Usage}
\begin{verbatim}
comp.t(L = NULL, mu = 0, var.equal = FALSE)
\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{mu}] A number indicating the true value of the mean (or
difference in means if you are performing a two sample test).

\item[\code{var.equal}] a logical variable indicating whether to treat the
two variances as being equal. If \code{TRUE} then the pooled
variance is used to estimate the variance otherwise the Welch
statistic will be calculated.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function returned by \code{comp.t} calculates t statistics for
each row of the microarary data matrix, given specific class labels.
\end{Details}
\begin{Value}
\code{comp.t} returns a function with bindings for \code{L},
\code{mu}, \code{var.equal}, which calculates and returns of vector of
t statistics for each row in the data matrix.
\end{Value}
\begin{Author}\relax
Yuanyuan Xiao, \email{yxiao@itsa.ucsf.edu}, \\
Jean Yee Hwa Yang, \email{jean@biostat.ucsf.edu}.
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{comp.FC}{comp.FC}}, \code{\LinkA{comp.F}{comp.F}}
\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

# two sample test, unequal variance
t.fun <- comp.t(L)
t.X <- t.fun(X)

# two sample test, equal variance
t.fun <- comp.t(L, var.equal=TRUE)
t.X <- t.fun(X)
\end{ExampleCode}
\end{Examples}

