# residuals.earth

##### Residuals for an earth model

Residuals of an `earth`

model.

- Keywords
- models

##### Usage

```
# S3 method for 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`

).`"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`

.`"deviance"`

Residuals as above, unless the object has a`glm`

component, in which case return the`glm`

deviance residuals.`"glm.pearson"`

`"glm.working"`

`"glm.response"`

`"glm.partial"`

Return the corresponding`glm`

residuals (from the`glm`

fit on`bx`

). Can be used only if the earth model has a`glm`

component.- 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

```
# NOT RUN {
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="earth")) # same
head(resid(earth.mod, type="deviance")) # GLM deviance residuals, a column for each response
# }
```

*Documentation reproduced from package earth, version 4.5.1, License: GPL-3*