Residuals From a Fitted Rpart Object
residuals.rpart.RdMethod for residuals for an rpart object.
Arguments
- object
fitted model object of class
"rpart".- type
Indicates the type of residual desired.
For regression or
anovatrees all three residual definitions reduce toy - fitted. This is the residual returned forusermethod trees as well.For classification trees the
usualresiduals are the missclassification losses L(actual, predicted) where L is the loss matrix. With default losses this residual is 0/1 for correct/incorrect classification. Thepearsonresidual is (1-fitted)/sqrt(fitted(1-fitted)) and thedevianceresidual is sqrt(minus twice logarithm of fitted).For
poissonandexp(or survival) trees, theusualresidual is the observed - expected number of events. Thepearsonanddevianceresiduals are as defined in McCullagh and Nelder.- ...
further arguments passed to or from other methods.
