View Splits for Nodes of a Tree Object

DESCRIPTION:
Display the change in deviance for each possible split at a selected node for all predictors in the formula of a fitted object of class "tree".

USAGE:
burl.tree(tree, nodes, screen.arg=<<see below>>,
          figs=c(1, length(xlevels)), plot = T)

REQUIRED ARGUMENTS:
tree:
fitted model object of class "tree". This is assumed to be the result of a function that produces an object with the same components as those returned by the function tree.

OPTIONAL ARGUMENTS:
nodes:
an integer representing the index (node number) of the node to be examined. If missing, user selects nodes interactively as described below.
screen.arg:
integer denoting the screen to be used for the plotting. By default the active current screen plus 1 (the next one) is used. See split.screen and tree.screens for more details.
figs:
the arrangement of sub-screens to further split the screen for the plotting of the individual variable plots. Generally, a vector of the form c(n,m) where n and m are integers. By default, all sub-plots are placed in a row.
plot:
logical flag; if nodes is given, should plotting be done?

VALUE:
an invisible (unless plot=FALSE) list of class c("tree.split", "data.frame"). This list has one component for predictor variable which corresponds to the last node selected interactively or to the one given in the argument nodes.

Each component of this list contains details of the competition for best split at that node in a data frame whose rows represent each potential split and with the following columns:

x:
this column is named after the predictor analyzed and contains the cutpoints or sequence numbers (subset splits).
dev:
vector of deviance change if node is split at x.
numl:
the number of observations in the left-hand split at each x.
cutleft:
in the case of a factor predictor, character vector of left-hand splits. These factor predictors are encoded as explained below in the DETAILS section.
cutright:
for factor predictors only, a character vector of right-hand splits.

SIDE EFFECTS:
For each node selected either with a mouse (interactively) or by using the argument nodes a plot of deviance change is displayed for each of the predictors in the formula used to fit tree.

GRAPHICAL INTERACTION:
This function checks that the user is in split-screen mode. A dendrogram of tree is expected to be visible on the current screen, and a graphics input device (e.g., a mouse) is required. Clicking the selection button on a node results in the additional screens being filled with the information described above. This process may be repeated any number of times.

Warnings result from selecting leaf nodes. Clicking the exit button will stop the burling process and return the list described above for the last node selected. See .Device and split.screen for specific details on graphic input and split-screen mode.


DETAILS:
The primary purpose of burl.tree is its graphical side effect: for each node selected or specified, a plot of the change in deviance at each possible split, on each available predictor. For continuous predictors, a high density plot displays the change in deviance for each cut point. For factor predictors, a scatterplot displays the change in deviance against an encoding of the subset split; the plotting symbol represents the left-hand split.

The strings of letters labeling splits for factor predictors are determined by a one-to-one correspondence of the letters of the alphabet (contained in the S-PLUS dataset letters) and the factor levels which can be obtained using the function levels. For example, "bd" represents the second and fourth levels of the corresponding predictor of class "factor".


NOTE:
You may need to attach the original data frame prior to using this function.

SEE ALSO:
edit.tree , plot.tree , tree , tree.object , tree.screens , split.screen .

EXAMPLES:
z <- tree(Mileage~Weight + Type, car.test.frame)
# open graphics device then execute the following:
tree.screens()
plot(z)
burl.tree(z)

z.cu <- tree(cu.summary, na.action = na.omit) # burl.tree() can be used non-interactively b3 <- burl.tree(z.cu, 3) # compute alternative splits at node 3

# burl.tree provides convenient input to edit.tree # edit according to the 6th split on Country z.edit <- edit.tree(z.cu, b3$Country[6, ])