\HeaderA{predict.tsp}{Prediction based on a tsp object}{predict.tsp}
\aliasA{predict}{predict.tsp}{predict}
\keyword{misc}{predict.tsp}
\begin{Description}\relax
This function can be used to predict outcome values for a data set
based on a tsp object.
\end{Description}
\begin{Usage}
\begin{verbatim}
  ## S3 method for class 'tsp':
  predict(object,dat=NULL,select=NULL,...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] A tsp object
\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{select}] An indicator of which TSP to use,defaults to the first
TSP.
\item[\code{...}] Plotting arguments (ignored)
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
predict() accepts a tsp object calculated on an expression set
or gene expression matrix. If no other data set is included, the tsp
predictions for the original data set are produced. If a second gene
expression matrix or expression set is included, predict() looks
for the gene names of the TSP in tspobj and attempts to match them
in the rownames or featureNames of the gene expression matrix. If
rownames or featureNames are not available, the prediction is based
on the row numbers.  If a match is identified, predict() makes a
prediction for each gene based on the output.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{predict}] A class prediction for each array of dat based on the
TSP from tspobj
\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.

A.C. Tan, D.Q. Naiman, L. Xu, R.L. Winslow, D. Geman, "Simple decision rules for classifying human cancers from gene expression profiles,"
Bioinformatics, 21:3896-3904, 2005.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{tspplot}{tspplot}},\code{\LinkA{ts.pair}{ts.pair}}, \code{\LinkA{tspcalc}{tspcalc}},\code{\LinkA{tspsig}{tspsig}},\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)

  ## Get predictions for a new eSet or data matrix
  predict.tsp(tsp1,dat2,1)
  predict(tsp1,eSet2,1)
 ## End(Not run)
\end{ExampleCode}
\end{Examples}

