\HeaderA{Plot.subjects}{Subjects Plot for GlobalAncova}{Plot.subjects}
\keyword{hplot}{Plot.subjects}
\begin{Description}\relax
Produces a plot to show the influence of the samples on the test result produced by \code{\LinkA{GlobalAncova}{GlobalAncova}}.

There are three possible ways of using \code{GlobalAncova}.
Also \code{Plot.subjects} can be invoked with these three alternatives.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S4 method for signature 'matrix, formula, formula, ANY,
##   missing, missing, missing':
Plot.subjects(xx, formula.full, formula.red, model.dat, test.genes, Colorgroup = NULL, sort = FALSE, legendpos = "topright", returnValues = FALSE, bar.names, ...)

## S4 method for signature 'matrix, formula, missing, ANY,
##   missing, missing, character':
Plot.subjects(xx, formula.full, test.terms, model.dat, test.genes, Colorgroup = NULL, sort = FALSE, legendpos = "topright", returnValues = FALSE, bar.names, ...)

## S4 method for signature 'matrix, missing, missing,
##   missing, ANY, ANY, missing':
Plot.subjects(xx, group, covars = NULL, test.genes, Colorgroup = NULL, sort = FALSE, legendpos = "topright", returnValues = FALSE, bar.names, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{xx}] Matrix of gene expression data, where columns correspond to samples
and rows to genes. The data should be properly normalized beforehand
(and log- or otherwise transformed). Missing values are not allowed.
Gene and sample names can be included as the row and column
names of \code{xx}.
\item[\code{formula.full}] Model formula for the full model.
\item[\code{formula.red}] Model formula for the reduced model (that does not contain the terms of interest.)
\item[\code{model.dat}] Data frame that contains all the variable information for each sample.
\item[\code{group}] Vector with the group membership information.
\item[\code{covars}] Vector or matrix which contains the covariate information for each sample.
\item[\code{test.terms}] Character vector that contains names of the terms of interest.
\item[\code{test.genes}] Vector of gene names or gene indices specifying the gene set. If missing, the plot refers to all genes in \code{xx}.
\item[\code{Colorgroup}] Character variable giving the group that specifies coloring.
If the function is called using the argument \code{group} then this variable is assumed to
be relevant for coloring.
\item[\code{sort}] Should the samples be ordered by \code{colorgroup}?
\item[\code{legendpos}] Position of the legend (a single
keyword from the list '"bottomright"', '"bottom"', '"bottomleft"',
'"left"', '"topleft"', '"top"', '"topright"', '"right"' and
'"center"').
\item[\code{returnValues}] Shall bar heights (subject-wise reduction in sum of squares) be returned?
\item[\code{bar.names}] Vector of bar labels. If missing, column names of \code{xx} are taken.
\item[\code{...}] Graphical parameters for specifying colors, titles etc.
\end{ldescription}
\end{Arguments}
\begin{Section}{Methods}
\describe{
\item[xx = "matrix", formula.full = "formula", formula.red = "formula", model.dat = "ANY", group = "missing", covars = "missing", test.terms = "missing"] In this method, besides the expression matrix \code{xx}, model formulas for the full
and reduced model and a data frame \code{model.dat} specifying corresponding model
terms have to be given. Terms that are included in the full but not in the reduced
model are those whose association with differential expression will be tested.
The arguments \code{group}, \code{covars} and \code{test.terms} are '"missing"'
since they are not needed for this method.

\item[xx = "matrix", formula.full = "formula", formula.red = "missing", model.dat = "ANY", group = "missing", covars = "missing", test.terms = "character"] In this method, besides the expression matrix \code{xx}, a model formula for the full
model and a data frame \code{model.dat} specifying corresponding model
terms are required. The character argument \code{test.terms} names the terms of interest
whose association with differential expression will be tested.
The arguments \code{formula.red}, \code{group} and \code{covars} are '"missing"'
since they are not needed for this method.

\item[xx = "matrix", formula.full = "missing", formula.red = "missing", model.dat = "missing", group = "ANY", covars = "ANY", test.terms = "missing"] Besides the expression matrix \code{xx} a clinical variable \code{group} is
required. Covariate adjustment is possible via the argument \code{covars} but
more complex models have to be specified with the methods described above.
This method emulates the function call in the first version of the package.
The arguments \code{formula.full}, \code{formula.red}, \code{model.dat} and
\code{test.terms} are '"missing"' since they are not needed for this method.
}
\end{Section}
\begin{Note}\relax
This work was supported by the NGFN project 01 GR 0459, BMBF, Germany.
\end{Note}
\begin{Author}\relax
Reinhard Meister \email{meister@tfh-berlin.de}\\
Ulrich Mansmann \email{mansmann@ibe.med.uni-muenchen.de}\\
Manuela Hummel \email{hummel@ibe.med.uni-muenchen.de}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{GlobalAncova}{GlobalAncova}}, \code{\LinkA{Plot.genes}{Plot.genes}}, \code{\LinkA{Plot.sequential}{Plot.sequential}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(vantVeer)
data(phenodata)
data(pathways)

Plot.subjects(xx = vantVeer, formula.full = ~metastases + ERstatus, formula.red = ~ERstatus, model.dat = phenodata, test.genes = pathways[[3]], colorgroup = "metastases")
Plot.subjects(xx = vantVeer, formula.full = ~metastases + ERstatus, test.terms = "metastases", model.dat = phenodata, test.genes = pathways[[3]], colorgroup = "metastases")
Plot.subjects(xx = vantVeer, group = phenodata$metastases, covars = phenodata$ERstatus, test.genes = pathways[[3]])
\end{ExampleCode}
\end{Examples}

