\HeaderA{residuals}{Extract Model Residuals}{residuals}
\aliasA{resid}{residuals}{resid}
\methaliasA{residuals.default}{residuals}{residuals.default}
\keyword{models}{residuals}
\keyword{regression}{residuals}
\begin{Description}\relax
\code{residuals} is a generic function which extracts model residuals
from objects returned by modeling functions.

The abbreviated form \code{resid} is an alias for \code{residuals}.
It is intended to encourage users to access object components through
an accessor function rather than by directly referencing an object
slot.

All object classes which are returned by model fitting functions
should provide a \code{residuals} method.  (Note that the method is
for \samp{residuals} and not \samp{resid}.)

Methods can make use of \code{\LinkA{naresid}{naresid}} methods to compensate
for the omission of missing values.  The default, \code{\LinkA{nls}{nls}} and
\code{\LinkA{smooth.spline}{smooth.spline}} methods do.
\end{Description}
\begin{Usage}
\begin{verbatim}
residuals(object, ...)
resid(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object for which the extraction of model residuals is
meaningful.
\item[\code{...}] other arguments.
\end{ldescription}
\end{Arguments}
\begin{Value}
Residuals extracted from the object \code{object}.
\end{Value}
\begin{References}\relax
Chambers, J. M. and Hastie, T. J. (1992)
\emph{Statistical Models in S}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{coefficients}{coefficients}}, \code{\LinkA{fitted.values}{fitted.values}},
\code{\LinkA{glm}{glm}}, \code{\LinkA{lm}{lm}}.
\end{SeeAlso}

