\HeaderA{pamr.fdr}{A function to estimate false discovery rates for the nearest shrunken centroid
classifier}{pamr.fdr}
\begin{Description}\relax
A function to estimate false discovery rates for the nearest shrunken centroid  classifier
\end{Description}
\begin{Usage}
\begin{verbatim}
pamr.fdr(trained.obj, data,  nperms=100, 
 xl.mode=c("regular","firsttime","onetime","lasttime"),xl.time=NULL, xl.prevfit=NULL)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{trained.obj}] The result of a call to pamr.train
\item[\code{data}] Data object; same as the one  passed to pamr.train
\item[\code{nperms}] Number of permutations for estimation of FDRs.  Default is 100
\item[\code{xl.mode}] Used by Excel interface
\item[\code{xl.time}] Used by Excel interface
\item[\code{xl.prevfit}] Used by Excel interface
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{pamr.fdr} estimates false discovery rates  for a nearest shrunken
centroid classifier
\end{Details}
\begin{Value}
A list with components:
\begin{ldescription}
\item[\code{results}] Matrix of estimates FDRs for various various threshold values.
Reported are both the median and 90th percentile of the  FDR over permutations
\item[\code{pi0}] The estimated proportion of genes that are null, i.e. not
significantly different
\end{ldescription}
\end{Value}
\begin{Author}\relax
Trevor Hastie,Robert Tibshirani, Balasubramanian Narasimhan, and Gilbert Chu
\end{Author}
\begin{References}\relax
\end{References}
\begin{Examples}
\begin{ExampleCode}
set.seed(120)
x <- matrix(rnorm(1000*20),ncol=20)
y <- sample(c(1:4),size=20,replace=TRUE)

mydata <- list(x=x,y=factor(y), geneid=as.character(1:nrow(x)), genenames=paste("g",as.character(1:nrow(x)),sep=""),)

mytrain <-   pamr.train(mydata)
myfdr <- pamr.fdr(mytrain, mydata)
\end{ExampleCode}
\end{Examples}

