Returns the deviance or weighted residual sum of squares of the model.
This function is generic (see Methods);
method functions can be written to handle specific classes of data.
Classes which already have methods for this function include:
gam, glm, lm, tree.
USAGE:
deviance(object, ...)
REQUIRED ARGUMENTS:
object:
a fitted model object.
OPTIONAL ARGUMENTS:
...:
methods may have additional arguments.
VALUE:
the deviance of the fitted model is returned.
DETAILS:
For glm, gam, and tree models, the "deviance" is a component
of object, in which case deviance is a simple extractor function.
For other models, the gaussian family is assumed and the
weighted residual sum of squares is returned.