\HeaderA{tspsig}{Significance calculation for top scoring pairs}{tspsig}
\keyword{misc}{tspsig}
\begin{Description}\relax
This function calculates the significance of a top-scoring pair. It
can be run after tspcalc() to calculate how strong a TSP is.
\end{Description}
\begin{Usage}
\begin{verbatim}
  tspsig(dat,grp,B=50,seed=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{dat}] Can take two values: (a) an m genes by n arrays matrix of expression data or (b) an eSet object
\item[\code{grp}] Can take one of two values: (a) A group indicator incharacter or numeric form, (b) an integer indicating the column of
pData(dat) to use as the group indicator
\item[\code{B}] The number of permutations to perform in calculation of the
p-value, default is 50.
\item[\code{seed}] If this is a numeric argument, the seed will be set for
reproducible p-values.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
tspsig() only works for two group classification. The computation time grows rapidly in the number of 
genes, so for large gene expression matrices one should be prepared
to wait or do a pre-filtering step. A progress bar is shown which
gives some indication of the time until the calculation is complete.
The top scoring pairs methodology was originally described in Geman et al. (2004).
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{p}] A p-value for testing the null hypothesis that there is no TSP
for the data set dat.
\item[\code{nullscores}] The null TSP scores from the permutation test.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Jeffrey T. Leek \email{jtleek@jhu.edu}
\end{Author}
\begin{References}\relax
D. Geman, C. d'Avignon, D. Naiman and R. Winslow, "Classifying gene expression profiles from pairwise mRNA comparisons," 
Statist. Appl. in Genetics and Molecular Biology, 3, 2004.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{tspplot}{tspplot}}, \code{\LinkA{ts.pair}{ts.pair}}, \code{\LinkA{tspcalc}{tspcalc}},\code{\LinkA{predict.tsp}{predict.tsp}}, \code{\LinkA{summary.tsp}{summary.tsp}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  ## Not run: 
  ## Load data
  data(tspdata) 

  ## Run tspcalc() on a data matrix and grp vector
  tsp1 <- tspcalc(dat,grp)

  ## Run tspsig() to get a p-value
  p <- tspsig(dat,grp)
  p
 ## End(Not run)
\end{ExampleCode}
\end{Examples}

