\HeaderA{plot.nfnGroupedData}{Plot an nfnGroupedData Object}{plot.nfnGroupedData}
\keyword{models}{plot.nfnGroupedData}
\begin{Description}\relax
A Trellis plot of the response versus the primary covariate is
generated. If outer variables are specified, the combination of their
levels are used to determine the panels of the Trellis
display. Otherwise, the levels of the grouping variable determine the
panels. A scatter plot of the response versus the primary covariate is
displayed in each panel, with observations corresponding to same
inner group joined by line segments. The Trellis function
\code{xyplot} is used.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'nfnGroupedData':
plot(x, outer, inner, innerGroups, xlab, ylab, strip, aspect, panel,
     key, grid, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object inheriting from class \code{nfnGroupedData},
representing a \code{groupedData} object with a numeric primary
covariate and a single grouping level.

\item[\code{outer}] an optional logical value or one-sided formula,
indicating covariates that are outer to the grouping factor, which
are used to determine the panels of the Trellis plot. If
equal to \code{TRUE}, \code{attr(object, "outer")} is used to
indicate the outer covariates. An outer covariate is invariant within
the sets of rows defined by the grouping factor.  Ordering of the
groups is done in such a way as to preserve adjacency of groups with
the same value of the outer variables. Defaults to \code{NULL},
meaning that no outer covariates are to be used.

\item[\code{inner}] an optional logical value or one-sided formula, indicating
a covariate that is inner to the grouping factor, which is used to
associate points within each panel of the Trellis plot. If
equal to \code{TRUE}, \code{attr(object, "inner")} is used to
indicate the inner covariate. An inner covariate can change within
the sets of rows defined by the grouping  factor. Defaults to
\code{NULL}, meaning that no inner covariate  is present. 

\item[\code{innerGroups}] an optional one-sided formula specifying a factor
to be used for grouping the levels of the \code{inner}
covariate. Different colors, or line types, are used for each level
of the \code{innerGroups} factor. Default is \code{NULL}, meaning
that no \code{innerGroups} covariate is present.

\item[\code{xlab, ylab}] optional character strings with the labels for the
plot. Default is the corresponding elements of \code{attr(object,
     "labels")} and \code{attr(object, "units")} pasted together.

\item[\code{strip}] an optional function passed as the \code{strip} argument to
the \code{xyplot} function. Default is \code{strip.default(..., style
     = 1)} (see \code{trellis.args}).

\item[\code{aspect}] an optional character string indicating the aspect ratio
for the plot passed as the \code{aspect} argument to the
\code{xyplot} function. Default is \code{"xy"} (see
\code{trellis.args}). 

\item[\code{panel}] an optional function used to generate the individual
panels in the Trellis display, passed as the \code{panel} argument
to the \code{xyplot} function.
\item[\code{key}] an optional logical function or function. If \code{TRUE}
and \code{innerGroups} is non-\code{NULL}, a legend for the
different \code{innerGroups} levels is included at the top of the
plot. If given as a function, it is passed as the \code{key} argument
to the \code{xyplot} function.  Default is \code{TRUE} if
\code{innerGroups} is non-\code{NULL} and \code{FALSE} otherwise.

\item[\code{grid}] an optional logical value indicating whether a grid should
be added to plot. Default is \code{TRUE}.
\item[\code{...}] optional arguments passed to the \code{xyplot} function.
\end{ldescription}
\end{Arguments}
\begin{Value}
a Trellis plot of the response versus the primary covariate.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{References}\relax
Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for Longitudinal
Data", in "Modelling Longitudinal and Spatially Correlated Data:
Methods, Applications and Future Directions", T.G. Gregoire (ed.),
Springer-Verlag, New York.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{groupedData}{groupedData}}, \code{\LinkA{xyplot}{xyplot}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# different panels per Subject
plot(Orthodont)
# different panels per gender
plot(Orthodont, outer = TRUE)
\end{ExampleCode}
\end{Examples}

