naresid                 package:base                 R Documentation

Adjust for Missing Values

Description:

     Use missing value information to adjust residuals and predictions.

Usage:

     naresid(omit, x, ...)
     napredict(omit, x, ...)

Arguments:

    omit: An object produced by an `na.action' function. 

       x: A vector, data frame, or matrix to be adjusted based upon the
          missing value information. 

     ...: further arguments passed to or from other methods.

Details:

     These are utility functions used to allow `predict' and `resid'
     methods for modelling functions to compensate for the removal of
     `NA's in the fitting process.  There are used by the default,
     `"lm"' and `"glm"' methods, and by further methods in packages
     `MASS', `rpart' and `survival'.

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

     Currently `naresid' and `napredict' are identical, but future
     methods need not be.  `naresid' is used for residuals, and
     `napredict' for fitted values and predictions.

Value:

     These return a similar object to `x'.

Note:

     Packages `rpart' and `survival5' used to contain versions of these
     functions that had an `na.omit' action equivalent to that now used
     for `na.exclude'.

