\HeaderA{calcTNullFast}{Compute Null T Distribution for Each Gene}{calcTNullFast}
\keyword{array}{calcTNullFast}
\keyword{htest}{calcTNullFast}
\begin{Description}\relax
Computes a null t distribution for each gene by permuting the phenotypes.
\end{Description}
\begin{Usage}
\begin{verbatim}
calcTNullFast(tab, phenotype, nsim, ngroups = 2, allphenotypes = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{tab}] a numeric matrix of expression values, with the rows and
columns representing probe sets and sample arrays, respectively
\item[\code{phenotype}] a numeric (or character if \code{ngroups} \textgreater{}= 2)
vector indicating the phenotype
\item[\code{nsim}] an integer indicating the number of permutations to use
\item[\code{ngroups}] an integer indicating the number of groups in the expression
matrix
\item[\code{allphenotypes}] a boolean indicating whether the function should
consider all possible permutations of the phenotype, including the
original, non-permuted phenotype
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Similar to \code{calcTStatFast} but calculates t-statistics over permuted
phenotypes.  If \code{allphenotypes == FALSE}, then any permutation
that has a permuted phenotype equal to the original phenotype will be
repermuted.  For example, all the possible permutations for
\code{phenotype == c(0,0,1,1)} are \code{c(0,0,1,1)},
\code{c(0,1,0,1)}, \code{c(1,0,1,0)}, \code{c(1,0,0,1)},
\code{c(0,1,1,0)}, and \code{c(1,1,0,0)}.  If \code{allphenotypes ==
    FALSE}, then the results will not include values from the
\code{c(0,0,1,1)} case.

The help file of \code{calcTStatFast} has more details on the
different statistics one can calculate based on the
value specified for \code{ngroups}.
\end{Details}
\begin{Value}
A matrix with \code{nsim} rows and \code{nrow(tab)} columns.
\end{Value}
\begin{Author}\relax
Weil Lai
\end{Author}

