Panel Generating Functions       package:party       R Documentation

_V_i_s_u_a_l_i_z_a_t_i_o_n _o_f _B_i_n_a_r_y _R_e_g_r_e_s_s_i_o_n _T_r_e_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The plot method for 'BinaryTree' objects is rather flexible and
     can be extended by panel functions. Some pre-defined panel
     generating  functions for the most important cases are documented
     here.

_U_s_a_g_e:

     node_inner(ctreeobj, digits = 3, abbreviate = FALSE, 
       fill = "white", id = TRUE)
     node_terminal(ctreeobj, digits = 3, abbreviate = FALSE, 
       fill = c("lightgray", "white"), id = TRUE)
     edge_simple(ctreeobj, digits = 3, abbreviate = FALSE)
     node_surv(ctreeobj, ylines = 2, id = TRUE, ...)
     node_barplot(ctreeobj, col = "black", fill = "lightgray", ymax = NULL,
       ylines = 3, widths = 1, gap = NULL, id = TRUE)
     node_boxplot(ctreeobj, col = "black", fill = "lightgray",  width = 0.5,
       yscale = NULL, ylines = 3, id = TRUE)
     node_hist(ctreeobj, col = "black", fill = "lightgray", freq = FALSE,
       horizontal = TRUE, xscale = NULL, ymax = NULL, ylines = 3,
       id = TRUE, ...)
     node_density(ctreeobj, col = "black", rug = TRUE, horizontal = TRUE,
       xscale = NULL, yscale = NULL, ylines = 3, id = TRUE)

_A_r_g_u_m_e_n_t_s:

ctreeobj: an object of class 'BinaryTree'.

  digits: integer, used for formating numbers. 

abbreviate: logical indicating whether strings should be  abbreviated. 

     col: a color for points and lines. 

    fill: a color to filling rectangles. 

      id: a logical indicating whether the node ID should be plotted.

  ylines: number of lines in y-direction. 

  widths: widths in barplots. 

   width: width in boxplots. 

     gap: gap between bars in a barplot ('node_barplot'). 

  yscale: limits in y-direction

  xscale: limits in x-direction

    ymax: upper limit in y-direction

horizontal: logical indicating if the plots should be horizontal. 

    freq: logical; if 'TRUE', the histogram graphic is a representation
          of frequencies. If 'FALSE', probabilities are plotted.

     rug: logical indicating if a rug representation should be added. 

     ...: additional arguments passed to callies.

_D_e_t_a_i_l_s:

     The 'plot' method for 'BinaryTree' objects provides an extensible
     framework for the visualization of binary regression trees. The
     user is allowed to specify panel functions for plotting terminal
     and inner nodes as well as the corresponding edges. For
     convenience, the panel generating functions 'node_inner' and
     'edge_simple'  return panel functions to draw inner nodes and left
     and right edges.  For drawing terminal nodes, the functions
     returned by the other panel  functions can be used. The panel
     generating function 'panel_terminal_node'  is a terse text-based
     representation of terminal nodes.

     Graphical representations of terminal nodes are available and
     depend on the measurement scale of the response variable the tree
     was fitted to. 'node_surv' returns a functions that plots
     Kaplan-Meier curves in each  terminal node. 'node_barplot',
     'node_boxplot', 'node_hist' and 'node_density' can be used to plot
     barplots, boxplots, histograms and  estimated densities into the
     terminal nodes.

_E_x_a_m_p_l_e_s:

       data(airquality)
       airq <- subset(airquality, !is.na(Ozone))
       airct <- ctree(Ozone ~ ., data = airq)

       ### very simple; the mean is given in each terminal node
       plot(airct, type = "simple")

       ### density estimates
       plot(airct, terminal_panel = node_density)
         
       ### histograms 
       plot(airct, terminal_panel = node_hist)

       ### boxplots
       plot(airct, terminal_panel = node_boxplot, drop_terminal = TRUE)

