residuals.arbor
Residuals from an Arbor Object
Usage
residuals.arbor(object, type = c("usual", "pearson", "deviance"))
Arguments
object |
fitted model object of class arbor. This is assumed to be the result
of some function that produces an object with the same named
components as that returned by the arbor 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),
"pearson" (sum of the observed minus fitted squared over fitted), and
"deviance" (minus twice logarithm of fitted).
|
Value
vector of residuals of type type from a fitted arbor object.
Examples
library("arbor")
data(solder, package = "Sdatasets")
fit <- arbor(skips ~ Opening + Solder + Mask + PadType + Panel,
data = solder, method = 'anova')
pr <- data.frame(predict(fit), residuals(fit))
pr[880:900,]