\HeaderA{getGroupsFormula}{Extract Grouping Formula}{getGroupsFormula}
\methaliasA{getGroupsFormula.default}{getGroupsFormula}{getGroupsFormula.default}
\methaliasA{getGroupsFormula.gls}{getGroupsFormula}{getGroupsFormula.gls}
\methaliasA{getGroupsFormula.lme}{getGroupsFormula}{getGroupsFormula.lme}
\methaliasA{getGroupsFormula.lmList}{getGroupsFormula}{getGroupsFormula.lmList}
\methaliasA{getGroupsFormula.reStruct}{getGroupsFormula}{getGroupsFormula.reStruct}
\keyword{models}{getGroupsFormula}
\begin{Description}\relax
The conditioning expression associated with \code{formula(object)}
(i.e. the expression after the \code{|} operator) is returned either as
a named list of one-sided formulas, or a single one-sided formula,
depending on the value of \code{asList}. The components of the
returned list are ordered from outermost to innermost level and are
named after the grouping factor expression.
\end{Description}
\begin{Usage}
\begin{verbatim}
getGroupsFormula(object, asList, sep)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] any object from which a formula can be extracted.
\item[\code{asList}] an optional logical value. If \code{TRUE} the returned
value with be a list of formulas; else, if \code{FALSE} the returned
value will be a one-sided formula. Defaults to \code{FALSE}.
\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}
a one-sided formula, or a list of one-sided formulas, with the
grouping structure associated with \code{formula(object)}. If no
conditioning expression is present in \code{formula(object)} a
\code{NULL} value is returned.
\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{\LinkA{getGroupsFormula.gls}{getGroupsFormula.gls}},
\code{\LinkA{getGroupsFormula.lmList}{getGroupsFormula.lmList}},
\code{\LinkA{getGroupsFormula.lme}{getGroupsFormula.lme}},
\code{\LinkA{getGroupsFormula.reStruct}{getGroupsFormula.reStruct}},
\code{\LinkA{getGroups}{getGroups}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
getGroupsFormula(y ~ x | g1/g2)
\end{ExampleCode}
\end{Examples}

