Learn R Programming

rpart (version 2.0-3)

residuals.rpart: Residuals From a Fitted Rpart Object

Description

Method for residuals for an rpart object.

Usage

residuals.rpart(object, type)

Arguments

object
fitted model object of class rpart. This is assumed to be the result of some function that produces an object with the same named components as that returned by the rpart function.
type
Indicates method of residual for a classification tree (no distinction is made for methods "anova", "poisson", or "exp"). Allows the following types of residuals: "usual" (misclassification errors

Value

  • vector of residuals of type type from a fitted rpart object.

Examples

Run this code
data(solder)
fit <- rpart(skips ~ Opening + Solder + Mask + PadType + Panel,
       data=solder, method='anova')
summary(residuals(fit))
plot(predict(fit),residuals(fit))

Run the code above in your browser using DataLab