Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

residuals.earth

Residuals for an earth model


Description

Residuals of an earth model.

Usage

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

Arguments

object

An earth object. This is the only required argument.

type

One of:

"earth" (default) Residuals from the lm fit on bx.
"response" Residuals as above, but for earth-glm models return the glm response residuals.
"standardize" Residuals divided by se * sqrt(1 - h_ii). See the standardize argument of plot.earth.
"delever" Residuals divided by sqrt(1 - h_ii). See the delever argument of plot.earth.

The following options are for earth-glm models. They return the GLM residuals (from the glm fit on bx). See residuals.glm for details:

"deviance"
"pearson"
"working"
"partial"

The following options for earth-glm models are redundant. They are provided for compatibility with older versions of earth or other functions:

"glm.response" same as "response"
"glm.deviance" same as "deviance"
"glm.pearson" same as "pearson"
"glm.working" same as "working"
"glm.partial" same as "partial"

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

Examples

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

earth

Multivariate Adaptive Regression Splines

v5.3.0
GPL-3
Authors
Stephen Milborrow. Derived from mda:mars by Trevor Hastie and Rob Tibshirani. Uses Alan Miller's Fortran utilities with Thomas Lumley's leaps wrapper.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.