\HeaderA{adjPval}{Generate FDR adjusted P values for F test result.}{adjPval}
\keyword{utilities}{adjPval}
\begin{Description}\relax
This function takes a result object from \code{\LinkA{matest}{matest}}
and calcualte the FDR adjusted P values. The new P values will be
appended to the input object as additional fields.
\end{Description}
\begin{Usage}
\begin{verbatim}
adjPval(matestobj, method=c("stepup","adaptive", "stepdown"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{matestobj}] An object of class \code{matest}, which is the result
from \code{\LinkA{matest}{matest}}.
\item[\code{method}] The method for FDR control.
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{matest} with the following fields added for
each F test:
\begin{ldescription}
\item[\code{adjPtab}] FDR adjusted tabulated P values.
\item[\code{adjPvalperm}] FDR adjusted permutation P values.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Hao Wu
\end{Author}
\begin{Examples}
\begin{ExampleCode}
data(paigen)
paigen <- createData(paigen.raw, n.rep=2)
model.noint.fix <- makeModel(data=paigen, formula=~Array+Dye+Spot+Strain+Diet)
# F-test strain effect
## Not run: 
test.strain.fix <- matest(paigen, model.noint.fix, term="Strain", n.perm=100,
        shuffle.method="resid", test.method=rep(1,4))
# make FDR adjusted P values
test.strain.fix <- adjPval(test.strain.fix)
## End(Not run)
# there will be new fields in test.strain.fix after this
\end{ExampleCode}
\end{Examples}

