Rev 6563 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File nlme/man/plot.nmGroupedData.Rd% Part of the nlme package for R% Distributed under GPL 2 or later: see nlme/LICENCE.note\name{plot.nmGroupedData}\title{Plot an nmGroupedData Object}\usage{\method{plot}{nmGroupedData}(x, collapseLevel, displayLevel, outer, inner,preserve, FUN, subset, key, grid, \dots)}\alias{plot.nmGroupedData}\arguments{\item{x}{an object inheriting from class \code{nmGroupedData},representing a \code{groupedData} object with multiple groupingfactors.}\item{collapseLevel}{an optional positive integer or character stringindicating the grouping level to use when collapsing the data. Levelvalues increase from outermost to innermost grouping. Default is thehighest or innermost level of grouping.}\item{displayLevel}{an optional positive integer or character stringindicating the grouping level to use for determining the panels inthe Trellis display, when \code{outer} is missing. Default is\code{collapseLevel}.}\item{outer}{an optional logical value or one-sided formula,indicating covariates that are outer to the \code{displayLevel}grouping factor, which are used to determine the panels of theTrellis plot. If equal to \code{TRUE}, the \code{displayLevel}element \code{attr(object, "outer")} is used to indicate theouter covariates. An outer covariate is invariant within the setsof rows defined by the grouping factor. Ordering of the groups isdone in such a way as to preserve adjacency of groups with the samevalue of the outer variables. Defaults to \code{NULL}, meaning thatno outer covariates are to be used.}\item{inner}{an optional logical value or one-sided formula, indicatinga covariate that is inner to the \code{displayLevel} grouping factor,which is used to associate points within each panel of the Trellisplot. If equal to \code{TRUE}, \code{attr(object, "outer")} is usedto indicate the inner covariate. An inner covariate can change withinthe sets of rows defined by the grouping factor. Defaults to\code{NULL}, meaning that no inner covariate is present.}\item{preserve}{an optional one-sided formula indicating a covariatewhose levels should be preserved when collapsing the data accordingto the \code{collapseLevel} grouping factor. The collapsing factor isobtained by pasting together the levels of the \code{collapseLevel}grouping factor and the values of the covariate to bepreserved. Default is \code{NULL}, meaning that no covariates need tobe preserved.}\item{FUN}{an optional summary function or a list of summary functionsto be used for collapsing the data. The function or functions areapplied only to variables in \code{object} that vary within thegroups defined by \code{collapseLevel}. Invariant variables arealways summarized by group using the unique value that they assumewithin that group. If \code{FUN} is a singlefunction it will be applied to each non-invariant variable by groupto produce the summary for that variable. If \code{FUN} is a list offunctions, the names in the list should designate classes ofvariables in the data such as \code{ordered}, \code{factor}, or\code{numeric}. The indicated function will be applied to anynon-invariant variables of that class. The default functions to beused are \code{mean} for numeric factors, and \code{Mode} for both\code{factor} and \code{ordered}. The \code{Mode} function, definedinternally in \code{gsummary}, returns the modal or most popularvalue of the variable. It is different from the \code{mode} functionthat returns the S-language mode of the variable.}\item{subset}{an optional named list. Names can be either positiveintegers representing grouping levels, or names of groupingfactors. Each element in the list is a vector indicating the levelsof the corresponding grouping factor to be used for plotting thedata. Default is \code{NULL}, meaning that all levels areused.}\item{key}{an optional logical value, or list. If \code{TRUE}, a legendis included at the top of the plot indicating which symbols (colors)correspond to which prediction levels. If \code{FALSE}, no legendis included. If given as a list, \code{key} is passed down as anargument to the \code{trellis} function generating the plots(\code{xyplot}). Defaults to \code{TRUE}.}\item{grid}{an optional logical value indicating whether a grid shouldbe added to plot. Default is \code{TRUE}.}\item{\dots}{optional arguments passed to the Trellis plot function.}}\description{The \code{groupedData} object is summarized by the values of the\code{displayLevel} grouping factor (or the combination of its valuesand the values of the covariate indicated in \code{preserve}, if any ispresent). The collapsed data is used to produce a new\code{groupedData} object, with grouping factor given by the\code{displayLevel} factor, which is plotted using theappropriate \code{plot} method for \code{groupedData} objects withsingle level of grouping.}\value{a Trellis display of the data collapsed over the values of the\code{collapseLevel} grouping factor and grouped according to the\code{displayLevel} grouping factor.}\references{Bates, D.M. and Pinheiro, J.C. (1997), "Software Design for LongitudinalData", in "Modelling Longitudinal and Spatially Correlated Data:Methods, Applications and Future Directions", T.G. Gregoire (ed.),Springer-Verlag, New York.}\author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{groupedData}}, \code{\link{collapse.groupedData}},\code{\link{plot.nfnGroupedData}}, \code{\link{plot.nffGroupedData}}}\examples{# no collapsing, panels by Dogplot(Pixel, displayLevel = "Dog", inner = ~Side)# collapsing by Dog, preserving dayplot(Pixel, collapseLevel = "Dog", preserve = ~day)}\keyword{models}