\Header{getGroups.lme}{Extract lme Object Groups}
\keyword{models}{getGroups.lme}
\begin{Description}\relax
The grouping factors corresponding to the linear mixed-effects model
represented by \code{object} are extracted. If more than one level is
indicated in \code{level}, the corresponding grouping factors are
combined  into a data frame; else the selected grouping factor is
returned as a vector.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lme':
getGroups(object, form, level, data, sep)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{lme}, representing
a fitted linear mixed-effects model.
\item[\code{form}] this argument is included to make the method function
compatible with the generic and is ignored in this method.
\item[\code{level}] an optional integer vector giving the level(s) of grouping
to be extracted from \code{object}. Defaults to the highest or
innermost level of grouping.
\item[\code{data}] unused
\item[\code{sep}] character, the separator to use between group levels when
multiple levels are collapsed.  The default is \code{'/'}.
\end{ldescription}
\end{Arguments}
\begin{Value}
either a data frame with columns given by the grouping factors
indicated in \code{level}, or, when a single level is requested, a
factor representing the selected grouping factor.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{lme}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(Pixel)
fm1 <- lme(pixel ~ day + day^2, Pixel,
  random = list(Dog = ~day, Side = ~1))
getGroups(fm1, level = 1:2)
\end{ExampleCode}
\end{Examples}

