Tree Tools

S-PLUS provides a rich suite of tools for interactively examining a regression tree. To use Tree Tools, first use the Tree Models dialog to create a tree model. Save the tree model by specifying a name in the Save As field of the dialog.

All of these tools begin by creating a plot of the specified tree model. The Browse, Burl, Histogram, Identify, and Snip tools let you select splits or nodes on the plot and provide information on the selection. Click the left mouse button to make a selection. Click the right mouse button to leave the selection mode. With these tools it may be necessary to arrange windows prior to pressing OK or Apply so that the necessary Graph and Report windows are in view while making selections.

__image\treetool.gif

The Tree Tools dialog has the following options:

Model Selection

Model Object

Select a tree model object. To create such an object, use the Tree Models dialog and specify a Save As name.

Name String Match

Enter a pattern used to restrict the list shown in the Model Object dropdown list. The symbol "*" matches any character. For example, to view all objects that begin with "last", enter last*. Use "[ ]" to denote a list of character options. For example, "model1", "model2", and "model3" match model[123], but "model4" does not.

Variables to Plot

Hist Variables

Select variables for which to plot Histograms.

Rug/Tile Variable

Select a variable for Rug or Tile plots.

Tree Tool

Browse Tool

Select a node on the tree plot. Summary information on the node will appear in a Report window. Right-click to leave the selection mode. Specify a name in Save As to save a list of the node information.

Burl Tool

Select a split on the tree plot. Plots will appear under the tree plot which display the change in deviance for all candidate splits. The actual split will have the largest change in deviance. These plots are useful for examining whether other splits would produce an improvement in fit similar to the improvement from the actual split. Right-click to leave the selection mode. Specify a name in Save As to save a list with information on the candidate splits.

Histogram Tool

Specify variables for which to draw histograms in the Hist Variables field. Select a split on the tree plot. Plots will appear under the tree plot which display histograms of the specified variables, with separate histograms for the values in the two nodes resulting from the split. Right-click to leave the selection mode. Specify a name in Save As to save a list of the variable values corresponding to the histograms.

Identify Tool

Select a node on the tree plot. The row names or numbers for the observations in that node will appear in a Report window. Right-click to leave the selection mode. Specify a name in Save As to save a list of the observations in each node.

Rug Tool

This tool is not interactive. Specify the variable to plot in the Rug/Tile Variable field. A high-density plot that shows the average value of the specified variable for observations in each leaf will be plotted beneath the tree plot. Specify a name in Save As to save a vector of the average values.

Snip Tool

Use this tool to create a new tree with some splits removed. Select a node on the tree plot to print the total tree deviance and what the total tree deviance would be if the subtree rooted at the node were removed. Click a second time on the same node to snip that subtree off and visually erase the subtree. This process may be repeated any number of times. Right-click to leave the selection mode. Specify a name in Save As to save the snipped tree.

Tile Tool

This tool is not interactive. Specify a variable to plot in the Rug/Tile Variable field. A vertical bar plot of the variable will be plotted beneath the tree plot. Factor variables have one bar per level. Numeric variables are quantized into four equi-sized ordered levels. Specify a name in Save As to save a matrix of frequency counts for the observations in each leaf.

Save Model Object

In the Save As field, enter the name for the object in which to save the results of the analysis. If an object with this name already exists, its contents are overwritten. The model object can be used in later functions such as plotting.