Learn R Programming

earth (version 2.3-0)

residuals.earth: Residuals for an "earth" model

Description

Residuals for an earth model.

Usage

## S3 method for class 'earth':
residuals(object = stop("no 'object' arg"),
          type = NULL, warn = TRUE, ...)

## S3 method for class 'earth':
resid(object = stop("no 'object' arg"),
      type = NULL, warn = TRUE, ...)

Arguments

object
An earth object. This is the only required argument.
type
One of "earth" (default) return earth residuals (from the lm fit on bx) "deviance" Return the earth lm residuals un
warn
This function gives warnings when the results are not what you may expect. Use warn=FALSE to turn of just these warnings.
...
Unused, but provided for generic/method consistency.

Value

  • The residual values (will be a matrix for multiple response models).

See Also

earth residuals resid identical to residuals

Examples

Run this code
data(etitanic)
a <- earth(pclass ~ ., data=etitanic, glm=list(family=binomial))
head(resid(a, warn=FALSE))      # earth residuals, a column for each response
head(resid(a, type="earth"))    # same
head(resid(a, type="deviance")) # GLM deviance residuals, a column for each response

Run the code above in your browser using DataLab