The DTREE Procedure

Displaying the Decision Tree

PROC DTREE draws the decision tree either in line-printer mode or in graphics mode. However, you need to have SAS/GRAPH software licensed at your site to use graphics mode. In many cases, the procedure draws the decision tree across page boundaries. If the decision tree diagram is drawn on multiple pages, the procedure numbers each page of the diagram on the upper right corner of the page (unless the NOPAGENUM option is specified). The pages are numbered starting with the upper left corner of the entire diagram. Thus, if the decision tree diagram is broken into three horizontal and four vertical levels and you want to paste all the pieces together to form one picture, they should be arranged as shown in Figure 5.10.


\begin{picture}  (3,3)     \thicklines      \put(0,3){\line(1,0)3}   \put(0,2.25){\lin...   ...85,2.85)9   \put(2.8,2.1){10}   \put(2.8,1.35){11}   \put(2.8,0.6){12}\end{picture}





Figure 5.10: Page Layout of the Decision Tree Diagram

The number of pages that are produced depends on the size of the tree and on the number of print positions that are available in the horizontal and vertical directions. Table 5.28 lists all options you can use to control the number of pages.


Table 5.28: Options That Control the Number of Pages
Option Effect
DISPLAY=amounts of information displayed on the diagram
MAXPREC=maximum decimal width allowed (the precision) to format numerical values into w.d format
MAXWIDTH=maximum field width allowed to format numerical values
NOLABELno labels are displayed on the diagram
NWIDTH=maximum field width allowed to format outcome names
YBETWEEN=vertical spaces between two successive end nodes


If the GRAPHICS option is used, the following options can be used to control the number of pages:

Note that the font used for all text may also affect the number of pages needed. Some fonts take more space than others.

If the decision tree diagram is produced on a line printer, you can use the FORMCHAR= option to control the appearance the links and the junctions of the diagram. When the GRAPHICS options is specified, several options are available to enhance the appearance of the decision tree diagram. These are described in the section "Graphics Options". In addition, there are many other options available in the GOPTIONS statement and the SYMBOL statement for controlling the details of graphics output. Refer to the relevant chapters in SAS/GRAPH Software: Reference for a detailed discussion of the GOPTIONS and SYMBOL statements.

Table 5.29, Table 5.30, and Table 5.31, show the relationship among the options for controlling the appearance of texts, nodes, and links, respectively. The order that PROC DTREE uses in determining which option is in effect is also provided. For ODS purposes, the label of the decision tree diagram drawn in line-printer quality is "Treeplot."


Table 5.29: Options That Control Text Appearance
Object Specification   Search Order
TextFont1.the FTEXT= option
  2.the FTEXT= option in a GOPTIONS statement
  3.the Font attribute of the GraphDataText element of the current ODS style definition (if the GSTYLE system option is active)
  4.hardware font
 Color1.the CTEXT= option
  2.the CTEXT= option in a GOPTIONS statement
  3.the Color attribute of the GraphDataText element of the current ODS style definition (if the GSTYLE system option is active)
  4.the first color in the colors list
 Height1.the value of the HTEXT= option^1 times the value of the HTEXT= option^2 in a GOPTIONS statement


 ^1If this option is not specified, the default value 1 is used.


 ^2The default value of this option is 1 unit.

Table 5.30: Options That Control Node Appearance
Object Specification   Search Order
ChanceSymbol1.the VSYMBOLC= option
Nodes 2.the VALUE= and FONT= options in the mth generated SYMBOL definition, if SYMBOLC=m is used
  3.the default symbol, CIRCLE
 Color1.the CSYMBOLC= option
  2.the CV= option in the mth generated SYMBOL definition, if SYMBOLC=m is used
  3.the CSYMBOL= option in a GOPTIONS statement
  4.the ContrastColor attribute of the GraphData1 element of the current ODS style definition (if the GSTYLE system option is active)
  5.the fifth color in the colors list
 Height1.h times the value of the HEIGHT= option in the mth generated SYMBOL definition, if both the HSYMBOL=h and the SYMBOLC=m are specified
  2.the HSYMBOL= option, if it is specified
  3.the HEIGHT= option in the mth generated symbol definition, if SYMBOLC=m is used
  4.the default value, 1 cell
DecisionSymbol1.the VSYMBOLD= option
Nodes 2.the VALUE= and FONT= options in the dth generated SYMBOL definition, if SYMBOLD=d is used
  3.the default value, SQUARE
 Color1.the CSYMBOLD= option
  2.the CV= option in the dth generated SYMBOL definition, if SYMBOLD=d is used
  3.the CSYMBOL= option in a GOPTIONS statement
  4.the ContrastColor attribute of the GraphData5 element of the current ODS style definition (if the GSTYLE system option is active)
  5.the fourth color in the colors list
 Height1.h times the value of the HEIGHT= option in the dth generated SYMBOL definition, if both the HSYMBOL=h and the SYMBOLD=d are specified
  2.the HSYMBOL= option, if it is specified
  3.the HEIGHT= option in the dth generated symbol definition, if SYMBOLD=d is used
  4.the default value, 1 cell
EndSymbol1.the VSYMBOLE= option
Nodes 2.the VALUE= and FONT= options in the nth generated SYMBOL definition, if SYMBOLE=n is used
  3.the default value, DOT
 Color1.the CSYMBOLE= option
  2.the CV= option in the nth generated SYMBOL definition if the option SYMBOLE=n is specified
  3.the CSYMBOL= option in a GOPTIONS statement
  4.the ContrastColor attribute of the GraphData8 element of the current ODS style definition (if the GSTYLE system option is active)
  5.the sixth color in the colors list
 Height1.h times the value of the HEIGHT= option in the nth generated SYMBOL definition, if both the HSYMBOL=h and the SYMBOLE=n are specified
  2.the HSYMBOL= option, if it is specified
  3.the HEIGHT= option in the nth generated symbol definition, if SYMBOLE=n is used
  4.the default value, 1 cell

Table 5.31: Options That Control Link Appearance
Object Specification   Search Order
LinksType1.the LSTYLE= option
for 2.the LINE= in the ith generated SYMBOL definition,
Regular  if LINKA=i is used
Outcomes 3.the default value, 1 (solid line)
 Color1.the CLINK= option
  2.the CI= option in the ith generated SYMBOL definition, if LINKA=i is used
  3.the ContrastColor attribute of the GraphData3 element of the current ODS style definition (if the GSTYLE system option is active)
  4.the third color in the colors list
 Thickness1.the LWIDTH= option
  2.the WIDTH= option in the ith generated SYMBOL definition, if LINKA=i is used
  3.the default value, 1
LinksType1.the LSTYLEB= option
for 2.the LINE= in the jth generated SYMBOL definition,
Optimal  if LINKB=j is used
Decision 3.the default value, 1 (solid line)
 Color1.the CBEST= option
  2.the CI= option in the jth generated SYMBOL definition, if LINKB=j is used
  3.the ContrastColor attribute of the GraphData2 element of the current ODS style definition (if the GSTYLE system option is active)
  4.the second color in the colors list
 Thickness1.the LWIDTHB= option
  2.the WIDTH= option in the jth generated SYMBOL definition, if LINKB=j is used
  3.2 times the thickness of links that represent regular outcomes
LinksType1.the LSTYLEC= option
That 2.the LINE= in the kth generated SYMBOL definition,
Fall  if LINKC=k is used
Across 3.the default value, 2 (dot line)
PagesColor1.depends on whether or not it represents an optimal decision
 Thickness1.depends on whether or not it represents an optimal decision

Previous Page | Next Page | Top of Page