10.4 Plotting the Result of CART


18306 plotcarttree(carttree{, outval})
plots the CART tree
18309 dispcarttree(ctdisp, xn, yn, carttree{, outval})
plots the CART tree in an user given display ctdisp
$ \{$tree, treelabel$ \}$ = 18312 grcarttree(carttree{, outval})
generates two graphical objects which contain the plot of the CART tree and the labels in the CART tree
18315 plotcart2(x, tree{, xname})
plots the cuts of CART in a two-dimensional projection of the dataset x
18318 dispcart2(cartdisp, xn, yn, x, carttree, ix, iy, depth, ssr)
plots the cuts of CART in a twodimensional projection of the dataset x in an user given display cartdisp
cut = 18321 grcart2(x, carttree, ix, iy, depth, ssr)
generates the cuts which contain a two-dimensional projection of the data x
For visualizing the results two methods are provided:
1.
plotting the tree via 18324 plotcarttree, 18327 dispcarttree or 18330 grcarttree
2.
18333 plotcart2, 18336 dispcart2 or 18339 grcart2 show how CART tesselates a two-dimensional projection of the data
As an output of 18342 cartsplit we receive the CART tree ( carttree). The first method plots the CART tree. Depending on the value given in outval we get as labels at the nodes in the tree the splitting rules (default), the numbers of observations in a node ("nelem"), the mean value of the observations in a node ( "mean") or the sum of squared residuals ("ssr") in a node. To get an overview how CART tesselates the space we can plot the tesselations in two dimensional projections of the data. The quantlet 18345 plotcart2 allows the user to interactively change the projections. Also interactively we can choose if we want to see all cuts to a specified level (see depth) or all cuts where the sum of squared residuals (see ssr) is above a specified limit. Note: if you view the cuts at the projection then be aware that cuts could appear in the tree which ar not visible. Thus the plot has to be interpreted with care! Additionally the plot can only be applied to projections of continuous variables.