\HeaderA{stat.t2}{Two-sample t-statistics}{stat.t2}
\aliasA{t2stat.func}{stat.t2}{t2stat.func}
\keyword{htest}{stat.t2}
\begin{Description}\relax
Computes two-sample t-statistics for each gene in a multi-slide
microarray experiment.
\end{Description}
\begin{Usage}
\begin{verbatim}
stat.t2(X, cl, x.ratio=FALSE, var.equal=TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{X}] if x.ratio=F, X is a list containing two components.  The
first component is a matrix of log intensity ratios
\eqn{M=\log_2 (R/G)}{} and the second component is the 
average log intensities \eqn{A = log_2 \sqrt{RG}}{A =
log_2(R*G)/2}, such as the output 
from \code{\LinkA{stat.ma}{stat.ma}}. If x.ratio=T, X is a matrix of log
expression ratios only.   The rows of X correspond to genes and 
columns correspond to different hybridizations, that is different
slides.
\item[\code{cl}] vector of class labels. Must consist of integers 1 and 2.
\item[\code{x.ratio}] logical flag: if TRUE, the matrix X contains only
log intensity ratios, if FALSE, X is a list containing two
components.  The first component is a matrix of log expression
ratios and the second component contains average log
intensities A.
\item[\code{var.equal}] logical flag: if TRUE, the variances of the class
1 and class 2 parent populations are assumed equal.
\item[\code{...}] other parameters used in \code{\LinkA{t.test}{t.test}}. 
\end{ldescription}
\end{Arguments}
\begin{Value}
List containing the following components

\begin{ldescription}
\item[\code{t}] the two-sample t-statistic for each gene;
\item[\code{Num }] the numerator of the t-statistic for each gene, with
names attribute "Num";
\item[\code{Denominator}] the denominator of the t-statistic for each gene, with
names attribute "Den";
\item[\code{n1}] number of class 1 observations used to calculate the
t-statistic for each gene;
\item[\code{n2}] number of class 2 observations used to calculate the
t-statistics for each gene;
\item[\code{Average A}] if x.ratio=F, the average across all
hybridizations of \eqn{A = log_2 \sqrt{RG}}{A = log_2(R*G)/2}, 
with names attribute "A.bar", if x.ratio=T, NULL is returned.
\end{ldescription}
\end{Value}
\begin{Note}\relax
\code{\LinkA{t2stat.func}{t2stat.func}} is called by \code{\LinkA{stat.t2}{stat.t2}}
and is not typically used on its own.
\end{Note}
\begin{Author}\relax
Sandrine Dudoit, \email{sandrine@stat.berkeley.edu} \\
Yee Hwa Yang, \email{yeehwa@stat.berkeley.edu}
\end{Author}
\begin{References}\relax
D. Freedman, R. Pisani, and
R. Purves. (1998). Statistics, 3rd ed. NewYork: W.W. Norton.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{t2stat.func}{t2stat.func}}, \code{\LinkA{plot.t2}{plot.t2}},
\code{\LinkA{plot.qq}{plot.qq}}, \code{\LinkA{t.test}{t.test}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(MouseArray)
## mouse.setup <- init.grid()
## mouse.data <- init.data() ## see \emph{init.data}
## mouse.lratio <- stat.ma(mouse.data, mouse.setup)
cl <- c(rep(1,3), rep(2,3))
mouse.t2 <- stat.t2(mouse.lratio, cl)
\end{ExampleCode}
\end{Examples}

