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

meanvar.rpart

Mean-Variance Plot for an Rpart Object


Description

Creates a plot on the current graphics device of the deviance of the node divided by the number of observations at the node. Also returns the node number.

Usage

meanvar(tree, ...)

## S3 method for class 'rpart'
meanvar(tree, xlab = "ave(y)", ylab = "ave(deviance)", ...)

Arguments

tree

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.

xlab

x-axis label for the plot.

ylab

y-axis label for the plot.

...

additional graphical parameters may be supplied as arguments to this function.

Value

an invisible list containing the following vectors is returned.

x

fitted value at terminal nodes (yval).

y

deviance of node divided by number of observations at node.

label

node number.

Side Effects

a plot is put on the current graphics device.

See Also

Examples

z.auto <- rpart(Mileage ~ Weight, car.test.frame)
meanvar(z.auto, log = 'xy')

rpart

Recursive Partitioning and Regression Trees

v4.1-15
GPL-2 | GPL-3
Authors
Terry Therneau [aut], Beth Atkinson [aut, cre], Brian Ripley [trl] (producer of the initial R port, maintainer 1999-2017)
Initial release
2019-04-10

We don't support your browser anymore

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