residuals: Extract Model Residuals

Description Usage Arguments Value References See Also


residuals is a generic function which extracts model residuals from objects returned by modeling functions.

The abbreviated form resid is an alias for 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 residuals method. (Note that the method is for residuals and not resid.)

Methods can make use of naresid methods to compensate for the omission of missing values. The default, nls and smooth.spline methods do.


residuals(object, ...)
resid(object, ...)



an object for which the extraction of model residuals is meaningful.


other arguments.


Residuals extracted from the object object.


Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See Also

coefficients, fitted.values, glm, lm.

influence.measures for standardized (rstandard) and studentized (rstudent) residuals.

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.