\HeaderA{residuals.lmList}{Extract lmList Residuals}{residuals.lmList}
\keyword{models}{residuals.lmList}
\begin{Description}\relax
The residuals are extracted from each \code{lm} component of
\code{object} and arranged into a list with as many components as
\code{object}, or combined into a single vector.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lmList':
residuals(object, type, subset, asList, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{lmList}, representing
a list of \code{lm} objects with a common model.

\item[\code{subset}] an optional character or integer vector naming the
\code{lm} components of \code{object} from which the residuals 
are to be extracted. Default is \code{NULL}, in which case all
components are used.

\item[\code{type}] an optional character string specifying the type of
residuals to be extracted. Options include \code{"response"} for the
"raw" residuals (observed - fitted), \code{"pearson"} for the
standardized residuals (raw residuals divided by the estimated
residual standard error) using different standard errors for each
\code{lm} fit, and \code{"pooled.pearson"} for the standardized
residuals using a pooled estimate of the residual standard
error. Partial matching of arguments is used, so only the first 
character needs to be provided. Defaults to \code{"response"}.

\item[\code{asList}] an optional logical value. If \code{TRUE}, the returned
object is a list with the residuals split by groups; else the
returned value is a vector. Defaults to \code{FALSE}.

\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
a list with components given by the residuals of each \code{lm}
component of \code{object}, or a vector with the residuals for all
\code{lm} components of \code{object}.
\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{lmList}{lmList}}, \code{\LinkA{fitted.lmList}{fitted.lmList}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- lmList(distance ~ age | Subject, Orthodont)
residuals(fm1)
\end{ExampleCode}
\end{Examples}

