\HeaderA{naresid}{Adjust for Missing Values}{naresid}
\aliasA{napredict}{naresid}{napredict}
\methaliasA{napredict.default}{naresid}{napredict.default}
\methaliasA{napredict.exclude}{naresid}{napredict.exclude}
\methaliasA{naresid.default}{naresid}{naresid.default}
\methaliasA{naresid.exclude}{naresid}{naresid.exclude}
\keyword{NA}{naresid}
\keyword{models}{naresid}
\begin{Description}\relax
Use missing value information to adjust residuals and predictions.
\end{Description}
\begin{Usage}
\begin{verbatim}
naresid(omit, x, ...)
napredict(omit, x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{omit}] an object produced by an \code{\LinkA{na.action}{na.action}} function,
typically the \code{"na.action"} attribute of the result of
\code{\LinkA{na.omit}{na.omit}} or \code{\LinkA{na.exclude}{na.exclude}}.
\item[\code{x}] a vector, data frame, or matrix to be adjusted based upon the
missing value information.
\item[\code{...}] further arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These are utility functions used to allow \code{\LinkA{predict}{predict}} and
\code{\LinkA{resid}{resid}} methods for modelling functions to compensate for
the removal of \code{NA}s in the fitting process.  They are used by
the default, \code{"lm"} and \code{"glm"} methods, and by further
methods in packages \pkg{MASS}, \pkg{rpart} and \pkg{survival}.

The default methods do nothing.  The default method for the \code{na.exclude}
action is to pad the object with \code{NA}s in the correct positions to
have the same number of rows as the original data frame.

Currently \code{naresid} and \code{napredict} are identical, but
future methods need not be.  \code{naresid} is used for residuals, and
\code{napredict} for fitted values and predictions.
\end{Details}
\begin{Value}
These return a similar object to \code{x}.
\end{Value}
\begin{Note}\relax
Packages \code{rpart} and \code{survival5} used to contain versions of
these functions that had an \code{na.omit} action equivalent to that
now used for \code{na.exclude}.
\end{Note}

