Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
SAS/OR® 14.1 User’s Guide:Project ManagementThe DTREE Procedure
This document is an individual chapter from SAS/OR® 14.1 User’s Guide: Project Management.
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2015. SAS/OR® 14.1 User’s Guide: ProjectManagement. Cary, NC: SAS Institute Inc.
SAS/OR® 14.1 User’s Guide: Project Management
Copyright © 2015, SAS Institute Inc., Cary, NC, USA
All Rights Reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or byany means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS InstituteInc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the timeyou acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher isillegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronicpiracy of copyrighted materials. Your support of others’ rights is appreciated.
U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer softwaredeveloped at private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, ordisclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, asapplicable, FAR 12.212, DFAR 227.7202-1(a), DFAR 227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S.federal law, the minimum restricted rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provisionserves as notice under clause (c) thereof and no other notice is required to be affixed to the Software or documentation. TheGovernment’s rights in Software and documentation shall be only those set forth in this Agreement.
SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414
July 2015
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in theUSA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
Chapter 7
The DTREE Procedure
ContentsOverview: DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384Getting Started: DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Introductory Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Attitudes toward Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390Sensitivity Analysis and Value of Perfect Information . . . . . . . . . . . . . . . . . 391Value of Perfect Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392Oil Wildcatter’s Problem with Sounding Test . . . . . . . . . . . . . . . . . . . . . . 393
Syntax: DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398PROC DTREE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401EVALUATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413MODIFY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413MOVE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414QUIT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414RECALL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414RESET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414SAVE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415SUMMARY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415TREEPLOT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415VARIABLES Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416VPC Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419VPI Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Details: DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420Input Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423Interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Options in Multiple Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424The Order of Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425Displayed Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428Displaying the Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429Web-Enabled Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433ODS Table Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434ODS Style Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434Precision Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436Computer Resource Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
384 F Chapter 7: The DTREE Procedure
Examples: DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437Example 7.1: Oil Wildcatter’s Problem with Insurance . . . . . . . . . . . . . . . . . 438Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting . . . . . . . . . . . . . 443Example 7.3: Contract Bidding Problem . . . . . . . . . . . . . . . . . . . . . . . . 454Example 7.4: Research and Development Decision Problem . . . . . . . . . . . . . . 459Example 7.5: Loan Grant Decision Problem . . . . . . . . . . . . . . . . . . . . . . 463Example 7.6: Petroleum Distributor’s Decision Problem . . . . . . . . . . . . . . . . 473Statement and Option Cross-Reference Tables . . . . . . . . . . . . . . . . . . . . . 482
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Overview: DTREE ProcedureThe DTREE procedure in SAS/OR software is an interactive procedure for decision analysis. The procedureinterprets a decision problem represented in SAS data sets, finds the optimal decisions, and plots on a lineprinter or a graphics device the decision tree showing the optimal decisions.
To use PROC DTREE you first construct a decision model to represent your problem. This model, calleda generic decision tree model, is made up of stages.1 Every stage has a stage name, which identifies thestage, as well as a type, which specifies the type of the stage. There are three types of stages: decision stages,chance stages, and end stages. In addition, every stage has possible outcomes.
A decision stage represents a particular decision you have to make. The outcomes of a decision stage arethe possible alternatives (or actions) of the decision. A chance stage represents an uncertain factor inthe decision problem (a statistician might call it a random variable; here it is called an uncertainty). Theoutcomes of a chance stage are events, one of which will occur according to a given probability distribution.An end stage terminates a particular scenario (a sequence of alternatives and events). It is not necessary toinclude an end stage in your model; the DTREE procedure adds an end stage to your model if one is needed.
Each outcome of a decision or chance stage also has several attributes, an outcome name to identify theoutcome, a reward to give the instant reward of the outcome, and a successor to specify the name of the stagethat comes next when this outcome is realized. For chance stages, a probability attribute is also needed. Itgives the relative likelihood of this outcome. Every decision stage should have at least two alternatives, andevery chance stage should have at least two events. Probabilities of events for a chance stage must sum to 1.End stages do not have any outcomes.
The structure of a decision model is given in the STAGEIN= data set. It contains the stage name, the type, andthe attributes (except probability) of all outcomes for each stage in your model. You can specify each stage inone observation or across several observations. If a diagrammatic representation of a decision problem is allyou want, you probably do not need any other data sets.
If you want to evaluate and analyze your decision problem, you need another SAS data set, called thePROBIN= data set. This data set describes the probabilities or conditional probabilities for every event inyour model. Each observation in the data set contains a list of given conditions (list of outcomes), if there areany, and at least one combination of event and probability. Each event and probability combination identifies
1The stages are often referred to as variables in many decision analysis articles.
Getting Started: DTREE Procedure F 385
the probability that the event occurs given that all the outcomes specified in the list occur. If no conditionsare given, then the probabilities are unconditional probabilities.
The third data set, called the PAYOFFS= data set, contains the value of each possible scenario. You canspecify one or more scenarios and the associated values in one observation. If the PAYOFFS= data set isomitted, the DTREE procedure assumes that all values are zero and uses rewards for outcomes to evaluatethe decision problem.
You can use PROC DTREE to display, evaluate, and analyze your decision problem. In the PROC DTREEstatement, you specify input data sets and other options. A VARIABLES statement identifies the variables inthe input data set that describe the model. This statement can be used only once and must appear immediatelyafter the PROC DTREE statement. The EVALUATE statement evaluates the decision tree. You can displaythe optimal decisions by using the SUMMARY statement, or you can plot the complete tree with theTREEPLOT statement. Finally, you can also associate HTML pages with decision tree nodes and createWeb-enabled decision tree diagrams.
It is also possible to interactively modify some attributes of your model with the MODIFY statement andto change the order of decisions by using the MOVE statement. Before making any changes to the model,you should save the current model with the SAVE statement so that you can call it back later by using theRECALL statement. Questions about the value of perfect information or the value of perfect control areanswered using the VPI and VPC statements. Moreover, any options that can be specified in the PROCDTREE statement can be reset at any time with the RESET statement.
All statements can appear in any order and can be used as many times as desired with one exception. TheRECALL statement must be preceded by at least one SAVE statement. In addition, only one model can besaved at any time; the SAVE statement overwrites the previously saved model. Finally, you can use the QUITstatement to stop processing and exit the procedure.
The DTREE procedure produces one output data set. The IMAGEMAP= data set contains the outlinecoordinates for the nodes in the decision tree that can be used to generate HTML MAP tags.
PROC DTREE uses the Output Delivery System (ODS), a SAS subsystem that provides capabilities fordisplaying and controlling the output from SAS procedures. ODS enables you to convert any of the outputfrom PROC DTREE into a SAS data set. For further details, refer to the chapter on ODS in the SAS/STATUser’s Guide.
Getting Started: DTREE Procedure
Introductory ExampleA decision problem for an oil wildcatter illustrates the use of the DTREE procedure. The oil wildcatter mustdecide whether or not to drill at a given site before his option expires. He is uncertain about many things:the cost of drilling, the extent of the oil or gas deposits at the site, and so on. Based on the reports of histechnical staff, the hole could be 'Dry' with probability 0.5, 'Wet' with probability 0.3, and 'Soaking'
with probability 0.2. His monetary payoffs are given in the following table.
386 F Chapter 7: The DTREE Procedure
Table 7.1 Monetary Payoffs of Oil Wildcatter’s Problem
Drill Not DrillDry 0 0Wet $700,000 0Soaking $1,200,000 0
The wildcatter also learned from the reports that the cost of drilling could be $150,000 with probability 0.2,$300,000 with probability 0.6, and $500,000 with probability 0.2. He can gain further relevant informationabout the underlying geological structure of this site by conducting seismic soundings. A cost controlprocedure that can make the probabilities of the 'High' cost outcomes smaller (and hence, the probabilitiesof the 'Low' cost outcomes larger) is also available. However, such information and control are quitecostly, about $60,000 and $120,000, respectively. The wildcatter must also decide whether or not to take thesounding test or the cost control program before he makes his final decision: to drill or not to drill.
The oil wildcatter feels that he should structure and analyze his basic problem first: whether or not to drill.He builds a model that contains one decision stage named 'Drill' (with two outcomes, 'Drill' and'Not_Drill') and two chance stages named 'Cost' and 'Oil_Deposit'. A representation of the modelis saved in three SAS data sets. In particular, the STAGEIN= data set can be saved as follows:
/* -- create the STAGEIN= data set -- */data Dtoils1;format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_SUCCES_ $12. ;input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $ _SUCCES_ $ ;datalines;Drill D Drill Cost. . Not_Drill .Cost C Low Oil_Deposit. . Fair Oil_Deposit. . High Oil_DepositOil_Deposit C Dry .. . Wet .. . Soaking .;
The structure of the decision problem is given in the Dtoils1 data set. As you apply this data set, you shouldbe aware of the following points:
� There is no reward variable in this data set; it is not necessary.
� The ordering of the chance stages 'Cost' and 'Oil_Deposit' is arbitrary.
� Missing values for the _SUCCES_ variable are treated as '_ENDST_' (the default name of the endstage) unless the associated outcome variable (_OUTCOM_) is also missing.
Introductory Example F 387
The following PROBIN= data set contains the probabilities of events:
/* -- create the PROBIN= data set -- */data Dtoilp1;input _EVENT1 $ _PROB1
_EVENT2 $ _PROB2_EVENT3 $ _PROB3 ;
datalines;Low 0.2 Fair 0.6 High 0.2Dry 0.5 Wet 0.3 Soaking 0.2;
Notice that the sum of the probabilities of the events 'Low', 'Fair', and 'High' is 1.0. Similarly, the sumof the probabilities of the events 'Dry', 'Wet', and 'Soaking' is 1.0.
Finally, the following statements produce the PAYOFFS= data set that lists all possible scenarios and theirassociated payoffs.
/* -- create PAYOFFS= data set -- */data Dtoilu1;format _STATE1-_STATE3 $12. _VALUE_ dollar12.0;input _STATE1 $ _STATE2 $ _STATE3 $ ;
/* determine the cost for this scenario */if _STATE1='Low' then _COST_=150000;else if _STATE1='Fair' then _COST_=300000;else _COST_=500000;
/* determine the oil deposit and the *//* corresponding net payoff for this scenario */if _STATE2='Dry' then _PAYOFF_=0;else if _STATE2='Wet' then _PAYOFF_=700000;else _PAYOFF_=1200000;
/* calculate the net return for this scenario */if _STATE3='Not_Drill' then _VALUE_=0;else _VALUE_=_PAYOFF_-_COST_;
/* drop unneeded variables */drop _COST_ _PAYOFF_;
datalines;Low Dry Not_DrillLow Dry DrillLow Wet Not_DrillLow Wet DrillLow Soaking Not_DrillLow Soaking DrillFair Dry Not_DrillFair Dry DrillFair Wet Not_DrillFair Wet DrillFair Soaking Not_DrillFair Soaking Drill
388 F Chapter 7: The DTREE Procedure
High Dry Not_DrillHigh Dry DrillHigh Wet Not_DrillHigh Wet DrillHigh Soaking Not_DrillHigh Soaking Drill;
This data set can be displayed, as shown in Figure 7.1, with the following PROC PRINT statements:
/* -- print the payoff table -- */
title "Oil Wildcatter's Problem";title3 "The Payoffs";
proc print data=Dtoilu1;run;
Figure 7.1 Payoffs of the Oil Wildcatter’s Problem
Oil Wildcatter's Problem
The Payoffs
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _VALUE_
1 Low Dry Not_Drill $0
2 Low Dry Drill $-150,000
3 Low Wet Not_Drill $0
4 Low Wet Drill $550,000
5 Low Soaking Not_Drill $0
6 Low Soaking Drill $1,050,000
7 Fair Dry Not_Drill $0
8 Fair Dry Drill $-300,000
9 Fair Wet Not_Drill $0
10 Fair Wet Drill $400,000
11 Fair Soaking Not_Drill $0
12 Fair Soaking Drill $900,000
13 High Dry Not_Drill $0
14 High Dry Drill $-500,000
15 High Wet Not_Drill $0
16 High Wet Drill $200,000
17 High Soaking Not_Drill $0
18 High Soaking Drill $700,000
The $550,000 payoff associated with the scenario 'Low', 'Wet', and 'Drill' is a net figure; it represents areturn of $700,000 for a wet hole less the $150,000 cost for drilling. Similarly, the net return of the conse-quence associated with the scenario 'High', 'Soaking', and 'Drill' is $700,000, which is interpreted asa return of $1,200,000 less the $500,000 'High' cost.
Now the wildcatter can invoke PROC DTREE to evaluate his model and to find the optimal decision usingthe following statements:
Introductory Example F 389
/* -- PROC DTREE statements -- */title "Oil Wildcatter's Problem";
proc dtree stagein=Dtoils1probin=Dtoilp1payoffs=Dtoilu1nowarning;
evaluate / summary;
The following message, which notes the order of the stages, appears on the SAS log:
NOTE: Present order of stages:
Drill(D), Cost(C), Oil_Deposit(C), _ENDST_(E).
Figure 7.2 Optimal Decision Summary of the Oil Wildcatter’s Problem
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Drill
Alternativesor
OutcomesCumulative
RewardEvaluating
Value
Drill $140,000*
Not_Drill $0
The SUMMARY option in the EVALUATE statement produces the optimal decision summary shown inFigure 7.2.
The summary shows that the best action, in the sense of maximizing the expected payoff, is to drill. Theexpected payoff for this optimal decision is $140,000, as shown on the summary.
Perhaps the best way to view the details of the results is to display the complete decision tree. The followingstatement draws the decision tree, as shown in Figure 7.3, in line-printer format:
390 F Chapter 7: The DTREE Procedure
/* plot decision tree diagram in line-printer mode */OPTIONS LINESIZE=100;treeplot/ lineprinter;
Figure 7.3 The Decision Tree
Oil Wildcatter's Problem
The DTREE Procedure
Line-printer Plot
Oil Wildcatter's Problem
The DTREE Procedure
Line-printer Plot
Dry -----------------------E | p=0.5 EV= $-150,000 Low | Wet -----------------------C-|----------------------E | p=0.2 EV= $300,000 | p=0.3 EV= $550,000 | | Soaking | -----------------------E | p=0.2 EV= $1,050,000 | Dry | -----------------------E | | p=0.5 EV= $-300,000 Drill | Fair | Wet -======================C-|----------------------C-|----------------------E | EV= $140,000 | p=0.6 EV= $150,000 | p=0.3 EV= $400,000 | | | Soaking | | -----------------------E | | p=0.2 EV= $900,000 | | Dry ----------------------D-| | -----------------------E EV= $140,000 | | | p=0.5 EV= $-500,000 | | High | Wet | -----------------------C-|----------------------E | p=0.2 EV= $-50,000 | p=0.3 EV= $200,000 | | Soaking | -----------------------E | p=0.2 EV= $700,000 |Not_Drill -----------------------E EV= $0
Attitudes toward RiskAssume now that the oil wildcatter is constantly risk averse and has an exponential utility function with a risktolerance (RT) of $700,000. The risk tolerance is a measure of the decision maker’s attitude to risk. See thesection “Evaluation” on page 425 for descriptions of the utility function and risk tolerance.
The new optimal decision based on this utility function can be determined with the following statement:
Sensitivity Analysis and Value of Perfect Information F 391
evaluate / criterion=maxce rt=700000 summary;
The summary, shown in Figure 7.4, indicates that the venture of investing in the oil well is worth $-13,580 tothe wildcatter, and he should not drill the well.
Figure 7.4 Summary of the Oil Wildcatter’s Problem with RT = $700,000
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $700,000
Optimal Decision Yields: $0
Optimal Decision Policy
Up to Stage Drill
Alternativesor
OutcomesCumulative
RewardEvaluating
Value
Drill $-13,580
Not_Drill $0*
Sensitivity Analysis and Value of Perfect InformationThe oil wildcatter learned that the optimal decision changed when his attitude toward risk changed. Since riskattitude is difficult to express quantitatively, the oil wildcatter wanted to learn more about the uncertainties inhis problem. Before spending any money on information-gathering procedures, he would like to know thebenefit of knowing, before the 'Drill' or 'Not_Drill' decision, the amount of oil or the cost of drilling.The simplest approach is to calculate the value of perfect information for each uncertainty. This quantitygives an upper limit on the amount that could be spent profitably on information gathering. The expectedvalue of information for the amount of oil is calculated by the following statement:
vpi Oil_Deposit;
The result of the previous statement is written to the SAS log as
NOTE: The currently optimal decision yields 140000.
392 F Chapter 7: The DTREE Procedure
NOTE: The new optimal decision yields 295000.NOTE: The value of perfect information of stage Oil_Deposit
yields 155000.
This means that the wildcatter could spend up to $155,000 to determine the amount of oil in the deposit withcertainty before losing money. There are several alternative ways to calculate the expected value of perfectinformation. For example, the following statement
vpi Cost;
is equivalent to
save;move Cost before Drill;evaluate;recall;
The messages, which appear on the SAS log, show that if there is some way that the wildcatter knows whatthe cost to drill will be before his decision has to be made, it will yield an expected payoff of $150,000. So,the expected value of perfect information about drilling cost is $150,000 - $140,000 = $10,000.
NOTE: The current problem has been successfully saved.
NOTE: Present order of stages:
Cost(C), Drill(D), Oil_Deposit(C), _ENDST_(E).
NOTE: The currently optimal decision yields 150000.
NOTE: The original problem has been successfully recalled.NOTE: Present order of stages:
Drill(D), Cost(C), Oil_Deposit(C), _ENDST_(E).
Value of Perfect ControlThe oil wildcatter may also want to know what the value of perfect control (VPC) is on the cost of drilling.That is, how much is he willing to pay for getting complete control on the drilling cost? This analysis can beperformed with the following statement:
vpc Cost;
The result is written to the SAS log as
NOTE: The currently optimal decision yields 140000.NOTE: The new optimal decision yields 300000.NOTE: The value of perfect control of stage Cost
yields 160000.
Oil Wildcatter’s Problem with Sounding Test F 393
Oil Wildcatter’s Problem with Sounding TestThe wildcatter is impressed with the results of calculating the values of perfect information and perfectcontrol. After comparing those values with the costs of the sounding test and the cost-controlling procedure,he prefers to spend $60,000 on sounding test, which has a potential improvement of $155,000. He isinformed that the sounding will disclose whether the terrain below has no structure (which is bad), openstructure (which is okay), or closed structure (which is really hopeful). The expert also provides him with thefollowing table, which shows the conditional probabilities.
Table 7.2 Conditional Probabilities of Oil Wildcatter’s Problem
Seismic OutcomesState No Structure Open Structure Closed StructureDry 0.6 0.3 0.1Wet 0.3 0.4 0.3Soaking 0.1 0.4 0.5
To include this additional information into his basic problem, the wildcatter needs to add two stages to hismodel: a decision stage to represent the decision whether or not to take the sounding test, and one chancestage to represent the uncertain test result. The new STAGEIN= data set is
/* -- create the STAGEIN= data set -- */data Dtoils2;format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $14.
_SUCCES_ $12. _REWARD_ dollar12.0;input _STNAME_ & _STTYPE_ & _OUTCOM_ &
_SUCCES_ & _REWARD_ dollar12.0;datalines;Drill D Drill Cost .. . Not_Drill . .Cost C Low Oil_Deposit .. . Fair Oil_Deposit .. . High Oil_Deposit .Oil_Deposit C Dry . .. . Wet . .. . Soaking . .Sounding D Noseismic Drill .. . Seismic Structure -$60,000Structure C No_Struct Drill .. . Open_Struct Drill .. . Closed_Struct Drill .;
Note that the cost for the seismic soundings is represented as negative reward (of the outcome Seismic) inthis data set. The conditional probabilities for stage Structure are added to the PROBIN= data set as follows:
394 F Chapter 7: The DTREE Procedure
/* -- create PROBIN= data set -- */data Dtoilp2;
format _EVENT1 $10. _EVENT2 $12. _EVENT3 $14. ;input _GIVEN_ $ _EVENT1 $ _PROB1
_EVENT2 $ _PROB2 _EVENT3 $ _PROB3;datalines;
. Low 0.2 Fair 0.6 High 0.2
. Dry 0.5 Wet 0.3 Soaking 0.2Dry No_Struct 0.6 Open_Struct 0.3 Closed_Struct 0.1Wet No_Struct 0.3 Open_Struct 0.4 Closed_Struct 0.3Soaking No_Struct 0.1 Open_Struct 0.4 Closed_Struct 0.5;
It is not necessary to make any change to the PAYOFFS= data set. To evaluate his new model, the wildcatterinvokes PROC DTREE as follows:
/* -- PROC DTREE statements -- */title "Oil Wildcatter's Problem";
proc dtree stagein=Dtoils2probin=Dtoilp2payoffs=Dtoilu1nowarning;
evaluate;
As before, the following messages are written to the SAS log:
NOTE: Present order of stages:
Sounding(D), Structure(C), Drill(D), Cost(C),Oil_Deposit(C), _ENDST_(E).
NOTE: The currently optimal decision yields 140000.
The following SUMMARY statements produce the optimal decision summary as shown in Figure 7.5 andFigure 7.6:
summary / target=Sounding;summary / target=Drill;
Oil Wildcatter’s Problem with Sounding Test F 395
The optimal strategy for the oil-drilling problem is found to be the following:
� No soundings test should be taken, and always drill. This alternative has an expected payoff of$140,000.
� If the soundings test is conducted, then drill unless the test shows the terrain below has no structure.
� The soundings test is worth $180,100 - $140,000 = $40,100 (this quantity is also called the value ofimperfect information or the value of sample information), but it costs $60,000; therefore, it should notbe taken.
Figure 7.5 Summary of the Oil Wildcatter’s Problem for SOUNDING
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Sounding Decision
Structure Chance
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Sounding
Alternativesor
OutcomesCumulative
RewardEvaluating
Value
Noseismic $0 $140,000*
Seismic $-60,000 $180,100
396 F Chapter 7: The DTREE Procedure
Figure 7.6 Summary of the Oil Wildcatter’s Problem for DRILL
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Sounding Decision
Structure Chance
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Drill
Alternatives or OutcomesCumulative
RewardEvaluating
Value
Noseismic Drill $0 $140,000*
Noseismic Not_Drill $0 $0
Seismic No_Struct Drill $-60,000 $-97,805
Seismic No_Struct Not_Drill $-60,000 $0*
Seismic Open_Struct Drill $-60,000 $204,286*
Seismic Open_Struct Not_Drill $-60,000 $0
Seismic Closed_Struct Drill $-60,000 $452,500*
Seismic Closed_Struct Not_Drill $-60,000 $0
Note that the value of sample information also can be obtained by using the following statements:
modify Seismic reward 0;evaluate;
The following messages, which appear in the SAS log, show the expected payoff with soundings test is$180,100. Recall that the expected value without test information is $140,000. Again, following the previouscalculation, the value of test information is $180,100 - $140,000 = $40,100.
NOTE: The reward of outcome Seismic has been changed to 0.
NOTE: The currently optimal decision yields 180100.
Now, the wildcatter has the information to make his best decision.
Syntax: DTREE Procedure F 397
Syntax: DTREE ProcedureThe following statements are available in PROC DTREE:
PROC DTREE options ;EVALUATE / options ;MODIFY specifications ;MOVE specifications ;QUIT ;RECALL ;RESET options ;SAVE ;SUMMARY / options ;TREEPLOT / options ;VARIABLES / options ;VPC specifications ;VPI specifications ;
The DTREE procedure begins with the PROC DTREE statement and terminates with the QUIT statement.The VARIABLES statement can be used only once, and if it is used, it must appear before any otherstatements. The EVALUATE, MODIFY, MOVE, RECALL, RESET, SAVE, SUMMARY, TREEPLOT,VPC, and VPI statements can be listed in any order and can be used as many times as desired with oneexception: the RECALL statement must be preceded by at least one SAVE statement.
You can also submit any other valid SAS statements, for example, OPTIONS, TITLE, and SAS/GRAPHglobal statements. In particular, the SAS/GRAPH statements that can be used to enhance the DTREEprocedure’s output on graphics devices are listed in Table 7.3. Note that the DTREE procedure is notsupported with the ActiveX or Java series of devices on the GOPTIONS statement. Refer to SAS/GRAPHSoftware: Reference for more explanation of these statements.
Table 7.3 Statements to Enhance Graphics Output
Statement FunctionFOOTNOTE Produce footnotes that are displayed on the graphics outputGOPTIONS Define default values for graphics optionsNOTE Produce text that is displayed on the graphics outputSYMBOL Create symbol definitionsTITLE Produce titles that are displayed on the graphics output
398 F Chapter 7: The DTREE Procedure
Functional SummaryTable 7.4 outlines the options available for the DTREE procedure, classified by function.
Table 7.4 Functional Summary
Description Statement Option
Accuracy Control OptionsSpecifies the accuracy of numerical com-putation
DTREE, RESET TOLERANCE=
Data Set SpecificationsSpecifies the Annotate data set DTREE, RESET, TREEPLOT ANNOTATE=Specifies the Image map output data set DTREE, RESET, TREEPLOT IMAGEMAP=Specifies the Payoffs data set DTREE PAYOFFS=Specifies the Probability data set DTREE PROBIN=Specifies the Stage data set DTREE STAGEIN=
Error Handling OptionsAutomatically rescales the probabilitiesof an uncertainty if they do not sum to 1
DTREE, RESET AUTOSCALE
Specifies the error handling behavior DTREE, RESET ERRHANDLE=Disables automatic rescaling of proba-bilities
DTREE, RESET NOSCALE
Disables warning messages DTREE, RESET NOWARNINGEnables warning messages DTREE, RESET WARNING
Evaluation Control OptionsSpecifies the criterion used to determinethe optimal decision
DTREE, EVALUATE, RESET CRITERION=
Specifies the risk tolerance DTREE, EVALUATE, RESET RT=
Format Control OptionsSpecifies the maximum decimal widthto format numerical values
DTREE, EVALUATE, RESET,SUMMARY, TREEPLOT
MAXPREC=
Specifies the maximum field width toformat numerical values
DTREE, EVALUATE, RESET,SUMMARY, TREEPLOT
MAXWIDTH=
Specifies the maximum field width toformat names
DTREE, EVALUATE, RESET,SUMMARY, TREEPLOT
NWIDTH=
Graphics Catalog OptionsSpecifies the description field for the cat-alog entry
DTREE, RESET, TREEPLOT DESCRIPTION=
Specifies the name of the graphics cata-log
DTREE, RESET, TREEPLOT GOUT=
Specifies the name field for the catalogentry
DTREE, RESET, TREEPLOT NAME=
Functional Summary F 399
Table 7.4 continued
Description Statement Option
Line-Printer OptionsSpecifies the characters for line-printerplot
DTREE, RESET, TREEPLOT FORMCHAR=
Link Appearance OptionsSpecifies the color of LOD1 DTREE, RESET, TREEPLOT CBEST=Specifies the color of all links exceptLOD1
DTREE, RESET, TREEPLOT CLINK=
Defines the symbol for all links exceptLOD1 and LCP2
DTREE, RESET, TREEPLOT LINKA=
Defines the symbol for LOD1 DTREE, RESET, TREEPLOT LINKB=Defines the symbol for LCP2 DTREE, RESET, TREEPLOT LINKC=Specifies the line type of all links exceptLOD1 and LCP2
DTREE, RESET, TREEPLOT LSTYLE=
Specifies the line type of LOD1 DTREE, RESET, TREEPLOT LSTYLEB=Specifies the line type of LCP2 DTREE, RESET, TREEPLOT LSTYLEC=Specifies the line thickness of all linksexcept LOD1
DTREE, RESET, TREEPLOT LWIDTH=
Specifies the line thickness of LOD1 DTREE, RESET, TREEPLOT LWIDTHB=
Node Appearance OptionsSpecifies the color of chance nodes DTREE, RESET, TREEPLOT CSYMBOLC=Specifies the color of decision nodes DTREE, RESET, TREEPLOT CSYMBOLD=Specifies the color of end nodes DTREE, RESET, TREEPLOT CSYMBOLE=Specifies the height of symbols for allnodes
DTREE, RESET, TREEPLOT HSYMBOL=
Specifies the symbol definition forchance nodes
DTREE, RESET, TREEPLOT SYMBOLC=
Specifies the symbol definition for deci-sion nodes
DTREE, RESET, TREEPLOT SYMBOLD=
Specifies the symbol definition for endnodes
DTREE, RESET, TREEPLOT SYMBOLE=
Specifies the symbol used for chancenodes
DTREE, RESET, TREEPLOT VSYMBOLC=
Specifies the symbol used for decisionnodes
DTREE, RESET, TREEPLOT VSYMBOLD=
Specifies the symbol used for end nodes DTREE, RESET, TREEPLOT VSYMBOLE=
Output Control OptionsSuppresses display of the optimal deci-sion summary
DTREE, EVALUATE, RESET NOSUMMARY
Displays the optimal decision summary DTREE, EVALUATE, RESET SUMMARY
400 F Chapter 7: The DTREE Procedure
Table 7.4 continued
Description Statement Option
Specifies the decision stage up to whichthe optimal decision summary is dis-played
DTREE, EVALUATE, RESET,SUMMARY
TARGET=
Plot Control OptionsDraws diagram on one page in graphicsmode
DTREE, RESET, TREEPLOT COMPRESS
Displays information on the decisiontree diagram
DTREE, RESET, TREEPLOT DISPLAY=
Processes the Annotate data set DTREE, RESET, TREEPLOT DOANNOTATEInvokes graphics version DTREE, RESET, TREEPLOT GRAPHICSDisplays labels DTREE, RESET, TREEPLOT LABELDisplays legend DTREE, RESET, TREEPLOT LEGENDInvokes line-printer version DTREE, RESET, TREEPLOT LINEPRINTERSuppresses processing of the Annotatedata set
DTREE, RESET, TREEPLOT NOANNOTATE
Draws diagram across multiple pages DTREE, RESET, TREEPLOT NOCOMPRESSSuppresses displaying label DTREE, RESET, TREEPLOT NOLABELSuppresses displaying legend DTREE, RESET, TREEPLOT NOLEGENDSuppresses displaying page number DTREE, RESET, TREEPLOT NOPAGENUMUses rectangular corners for turns in thelinks
DTREE, RESET, TREEPLOT NORC
Displays page number at upper right cor-ner
DTREE, RESET, TREEPLOT PAGENUM
Uses rounded corners for turns in thelinks
DTREE, RESET, TREEPLOT RC
Specifies the vertical space between twoend nodes
DTREE, RESET, TREEPLOT YBETWEEN=
Text Appearance OptionsSpecifies the text color DTREE, RESET, TREEPLOT CTEXT=Specifies the text font DTREE, RESET, TREEPLOT FTEXT=Specifies the text height DTREE, RESET, TREEPLOT HTEXT=
Variables in PAYOFFS= Data SetSpecifies the action outcome names VARIABLES ACTION=Specifies the state outcome names VARIABLES STATE=Specifies the payoffs VARIABLES VALUE=
Variables in PROBIN= Data SetSpecifies the event outcome names VARIABLES EVENT=Specifies the given outcome names VARIABLES GIVEN=Specifies the (conditional) probabilities VARIABLES PROB=
PROC DTREE Statement F 401
Table 7.4 continued
Description Statement Option
Variables in STAGEIN= Data SetSpecifies the outcome names VARIABLES OUTCOME=Specifies the rewards VARIABLES REWARD=Specifies the stage name VARIABLES STAGE=Specifies the successor names VARIABLES SUCCESSOR=Specifies the type of stage VARIABLES TYPE=Specifies the web reference variable VARIABLES WEB=
1LOD denotes links that indicate optimal decisions.
2LCP denotes links that continue on subsequent pages.
PROC DTREE StatementPROC DTREE options ;
The options that can appear in the PROC DTREE statement are listed in the following section. The optionsspecified in the PROC DTREE statement remain in effect for all statements until the end of processing oruntil they are changed by a RESET statement. These options are classified under appropriate headings: first,all options that are valid for all modes of the procedure are listed followed by the options classified accordingto the mode (line-printer or graphics) of invocation of the procedure.
General Options
AUTOSCALE j NOSCALEspecifies whether the procedure should rescale the probabilities of events for a given chance stage ifthe total probability of this stage is not equal to 1. The default is NOSCALE.
CRITERION=iindicates the decision criterion to be used for determining the optimal decision and the certain equivalentfor replacing uncertainties. The following table shows all valid values of i and their correspondingdecision criteria and certain equivalents.
Table 7.5 Values for the CRITERION= Option
i Criterion Certain EquivalentMAXEV Maximize Expected valueMINEV Minimize Expected value
MAXMLV Maximize Value with largest probabilityMINMLV Minimize Value with largest probabilityMAXCE Maximize Certain equivalent value of expected utilityMINCE Minimize Certain equivalent value of expected utility
The default value is MAXEV. The last two criteria are used when your utility curve can be fit byan exponential function. See the section “Evaluation” on page 425 for more information on theexponential utility function.
402 F Chapter 7: The DTREE Procedure
DISPLAY=(information-list)specifies information that should be displayed on each link of the decision tree diagram. Table 7.6 liststhe valid keywords and corresponding information.
Table 7.6 Information on Decision Tree and Keywords
Keyword InformationALL All information listed in this tableCR Cumulative rewards of outcomes on the path that leads to the successor
of the linkEV Evaluating value that can be expected from the successor of the linkLINK Outcome name represented by the linkP Probability of the outcome represented by the linkR Instant reward of the outcome represented by the linkSTAGE Stage name of the successor of the link
The default value is (LINK P EV R CR).
Note that the probability information displays on links that represent chance outcomes only. In addition,the PROBIN= option must be specified. The expected values display only if the decision tree hasbeen evaluated. The reward information displays on a link only if the instant reward of the outcomerepresented by the link is nonzero. The cumulative rewards do not display if the cumulative rewards oflinks are all zero.
ERRHANDLE=DRAIN j QUITspecifies whether the procedure should stop processing the current statement and wait for next statementor quit PROC DTREE when an error has been detected by the procedure. The default value is DRAIN.
GRAPHICScreates plots for a graphics device. To specify this option, you need to have SAS/GRAPH softwarelicensed at your site. This is the default.
LABEL j NOLABELspecifies whether the labels for information displayed on the decision tree diagram should be displayed.If the NOLABEL option is not specified, the procedure uses the following symbols to label all theinformation that is displayed on each link.
Table 7.7 Labels and Their Corresponding Information
Label Informationcr= The cumulative rewards of outcomes on the path that lead to the
successor of the linkEV= The value that can be expected from the successor of the linkp= The probability of the outcome represented by the linkr= The instant reward of the outcome
The default is LABEL.
PROC DTREE Statement F 403
LINEPRINTERLP
creates plots of line-printer quality. If you do not specify this option, graphics plots are produced.
MAXPREC=dspecifies the maximum decimal width (the precision) in which to format numerical values using w.dformat. This option is used in displaying the decision tree diagrams and the summaries. The value forthis option must be no greater than 9; the default value is 3.
MAXWIDTH=mwspecifies the maximum field width in which to format numerical values (probabilities, rewards,cumulative rewards and evaluating values) using w:d format. This option is used in displaying thedecision tree diagrams and the summaries. The value for this option must be no greater than 16 andmust be at least 5 plus the value of the MAXPREC= option. The default value is 10.
NWIDTH=nwspecifies the maximum field width in which to format outcome names when displaying the decisiontree diagrams. The value for this option must be no greater than 40; the default value is 32.
PAYOFFS=SAS-data-setnames the SAS data set that contains the evaluating values (payoffs, losses, utilities, and so on) foreach state and action combination. The use of PAYOFFS= is optional in the PROC DTREE statement.If the PAYOFFS= option is not used, PROC DTREE assumes that all evaluating values at the endnodes of the decision tree are 0.
PROBIN=SAS-data-setnames the SAS data set that contains the (conditional) probability specifications of outcomes. ThePROBIN= SAS data set is required if the evaluation of the decision tree is desired.
RT=rspecifies the value of the risk tolerance. The RT= option is used only when CRITERION=MAXCE orCRITERION=MINCE is specified. If the RT= option is not specified, and CRITERION=MAXCE orCRITERION=MINCE is specified, PROC DTREE changes the value of the CRITERION= option toMAXEV or MINEV (which would mean straight-line utility function and imply infinite risk tolerance).
STAGEIN=SAS-data-setnames the SAS data set that contains the stage names, stage types, names of outcomes, and theirrewards and successors for each stage. If the STAGEIN= option is not specified, PROC DTREE usesthe most recently created SAS data set.
SUMMARY j NOSUMMARYspecifies whether an optimal decision summary should be displayed each time the decision tree isevaluated. The decision summary lists all paths through the tree that lead to the target stage as well asthe cumulative rewards and the evaluating values of all alternatives for that path. The alternative withoptimal evaluating value for each path is marked with an asterisk (*). The default is NOSUMMARY.
TARGET=stagespecifies the decision stage up to which the optimal decision policy table is displayed. The TARGET=option is used only in conjunction with the SUMMARY option. The stage specified must be a decisionstage. If the TARGET= option is not specified, the procedure displays an optimal decision policy tablefor each decision stage.
404 F Chapter 7: The DTREE Procedure
TOLERANCE=dspecifies either a positive number close to 0 or greater than 1. PROC DTREE treats all numbers withine of 0 as 0, where
e D
�d if d < 1d � � otherwise
and � is the machine epsilon. The default value is 1,000.
WARNING j NOWARNINGspecifies whether the procedure should display a warning message when
� the payoff for an outcome is not assigned in the PAYOFFS= data set
� probabilities of events for a given chance stage have been automatically scaled by PROC DTREEbecause the total probability of the chance stage does not equal 1
The default is WARNING.
YBETWEEN=ybetween < units >specifies the vertical distance between two successive end nodes. If the GRAPHICS option is specified,the valid values for the optional units are listed in Table 7.8.
Table 7.8 Valid Values for the Units of the YBETWEEN= Option
Unit DescriptionCELL Character cellsCM CentimetersINCH InchesPCT Percentage of the graphics output areaSPACE Height of the box surrounding the node, its predecessor link, and
all text information
The value of the YBETWEEN= option must be greater than or equal to 0. Note that if the COMPRESSoption is specified, the actual distance between two successive end nodes is scaled by PROC DTREEand may not be the same as the YBETWEEN= specification.
If the LINEPRINTER option is specified, the optional units value can be CELL or SPACE. The valueof the YBETWEEN= option must be a nonnegative integer.
If you do not specify units, a unit specification is determined in the following order:
� the GUNIT= option in a GOPTIONS statement, if the GRAPHICS option is specified
� the default unit, CELL
The default value of YBETWEEN= option is 0.
PROC DTREE Statement F 405
Graphics Options
The following options are specifically for the purpose of producing a high-resolution quality decision treediagram.
ANNOTATE=SAS-data-set
ANNO=SAS-data-setspecifies an input data set that contains appropriate Annotate variables. The ANNOTATE= optionenables you to add features (for example, customized legend) to plots produced on graphics devices.For additional information, refer to the chapter on the annotate data set in SAS/GRAPH Software:Reference.
CBEST=color
CB=colorspecifies the color for all links in the decision tree diagram that represent optimal decisions. If you donot specify the CBEST= option, the color specification is determined in the following order:
� the CI= option in the jth generated SYMBOL definition, if the option LINKB=j is specified
� the ContrastColor attribute of the GraphData2 element of the current ODS style template (if theGSTYLE system option is active)
� the second color in the colors list
CLINK=color
CL=colorspecifies the color for all links in the decision tree diagram except those that represent optimal decisions.If the CLINK= option is not specified, the color specification is determined in the following order:
� the CI= option in the ith generated SYMBOL definition, if the option LINKA=i is specified
� the ContrastColor attribute of the GraphData3 element of the current ODS style template (if theGSTYLE system option is active)
� the third color in the colors list
COMPRESS j NOCOMPRESS
CP j NOCPspecifies whether the decision tree diagram should be drawn on one physical page. If the COMPRESSoption is specified, PROC DTREE determines the scale so that the diagram is compressed, if necessary,to fit on one physical page. Otherwise, the procedure draws the diagram across multiple pages ifnecessary. The default is NOCOMPRESS.
CSYMBOLC=color
CC=colorspecifies the color of the symbol used to draw all chance nodes in the decision tree diagram. If theCSYMBOLC= option is not specified, the color specification is determined in the following order:
� the CV= option in the mth generated SYMBOL definition, if the option SYMBOLC=m isspecified
� the CSYMBOL= option in a GOPTIONS statement
406 F Chapter 7: The DTREE Procedure
� the ContrastColor attribute of the GraphData1 element of the current ODS style template (if theGSTYLE system option is active)
� the fifth color in the colors list
CSYMBOLD=color
CD=colorspecifies the color of the symbol used to draw all decision nodes in the decision tree diagram. If theCSYMBOLD= option is not specified, the color specification is determined in the following order:
� the CV= option in the d th generated SYMBOL definition, if the option SYMBOLD=d is specified
� the CSYMBOL= option in a GOPTIONS statement
� the ContrastColor attribute of the GraphData5 element of the current ODS style template (if theGSTYLE system option is active)
� the fourth color in the colors list
CSYMBOLE=color
CE=colorspecifies the color of the symbol used to draw all end nodes in the decision tree diagram. If theCSYMBOLE= option is not specified, the color specification is determined in the following order:
� the CV= option in the nth generated SYMBOL definition, if the option SYMBOLE=n is specified
� the CSYMBOL= option in a GOPTIONS statement
� the ContrastColor attribute of the GraphData8 element of the current ODS style template (if theGSTYLE system option is active)
� the sixth color in the colors list
CTEXT=color
CT=colorspecifies the color to be used for all text that appears on plots except on TITLE and FOOTNOTE lines.If the CTEXT= option is not specified, the color specification is determined in the following order:
� the CTEXT= option in a GOPTIONS statement
� the Color attribute of the GraphDataText element of the current ODS style template (if theGSTYLE system option is active)
� the first color in the colors list
DESCRIPTION=‘string’
DES=‘string’specifies a descriptive string, up to 40 characters long, that appears in the description field of the mastermenu of PROC GREPLAY. If the DESCRIPTION= option is omitted, the description field contains adescription assigned by PROC DTREE.
PROC DTREE Statement F 407
DOANNOTATE j NOANNOTATEDOANNO j NOANNO
specifies whether the Annotate data set should be processed. If the NOANNOTATE option is specified,the procedure does not process the Annotate data set even though the ANNOTATE= option is specified.The default is DOANNOTATE.
FTEXT=nameFONT=name
specifies the font to be used for text on plots. If you do not use this option, the font specification isdetermined in the following order:
� the FTEXT= option in a GOPTIONS statement� the Font attribute of the GraphDataText element of the current ODS style template (if the
GSTYLE system option is active)� the hardware font for your graphics output device
Refer to the chapter on SAS/GRAPH fonts in SAS/GRAPH Software: Reference for details aboutSAS/GRAPH fonts.
GOUT=SAS-catalogspecifies the name of the graphics catalog used to save the output produced by PROC DTREE for laterreplay. For additional information, refer to the chapter on graphics output in SAS/GRAPH Software:Reference.
HSYMBOL=hHS=h
specifies that the height of symbols for all nodes in the decision tree diagram is h times the heights ofsymbols assigned by SAS/GRAPH software. You can specify the heights of decision nodes, chancenodes, and end nodes by using the HEIGHT= options in the corresponding SYMBOL statements. Forexample, if you specify the options HSYMBOL=2 and SYMBOLD=1 in the PROC DTREE statementand defined SYMBOL1 as
symbol1 height=4 pct;
then all decision nodes in the decision tree diagram are sized at 2 � 4 D 8% of the graphics outputarea. The default value is 1.
HTEXT=hHT=h
specifies that the height for all text in plots (except that in TITLE and FOOTNOTE statements) be htimes the height of the characters assigned by SAS/GRAPH software. You can also specify characterheight by using the HTEXT= option in a GOPTIONS statement.
For example, if you specify the option HTEXT=0.6 in the PROC DTREE statement and also specifieda GOPTIONS statement as follows
goptions htext=2 in;
then the size of all text is 0:6 � 2 D 1:2 inches. For more explanation of the GOPTIONS statement,refer to the chapter on the GOPTIONS statement in SAS/GRAPH Software: Reference. The defaultvalue is 1.
408 F Chapter 7: The DTREE Procedure
IMAGEMAP=SAS-data-setnames the SAS data set that receives a description of the areas of a graph and a link for each area. Thisinformation is for the construction of HTML image maps. You use a SAS DATA step to process theoutput file and generate your own HTML files. The graph areas correspond to the link information thatcomes from the WEB= variable in the STAGEIN= data set. This gives you complete control over theappearance and structure of your HTML pages.
LEGEND j NOLEGEND
LG j NOLGspecifies whether the default legend should be displayed. If the NOLEGEND is not specified, theprocedure displays a legend at the end of each page of the decision tree diagram. The default isLEGEND.
LINKA=iIf the LINKA=i option is specified, then PROC DTREE uses the color specified with the CI= option,the type specified with the LINE= option, and the thickness specified with the WIDTH= option inthe ith generated SYMBOL definition to draw all links in the decision tree diagram, except those thatindicate optimal decisions and those that are continued on subsequent pages. There is no default valuefor this option. The color, type, and thickness specifications may be overridden by the specifications ofthe CLINK=, LSTYLE=, and LWIDTH= options in the PROC DTREE statement.
Note that if you specify the LINKA=i option, PROC DTREE uses the specifications in the ith generatedSYMBOL definition and not the specifications in the SYMBOLi statement. Refer to SAS/GRAPHSoftware: Reference for the details about creating, canceling, reviewing, and altering SYMBOLdefinitions.
LINKB=jIf the LINKB=j option is specified, then PROC DTREE uses the color specified with the CI= option,the type specified with the LINE= option, and the thickness specified with the WIDTH= option inthe jth generated SYMBOL definition to draw all links that represent optimal decisions. There is nodefault value for this option. The color, type, and thickness specifications may be overridden by thespecifications of the CBEST=, LSTYLEB=, and LWIDTHB= options in the PROC DTREE statement.
Note that if you specify the LINKB=j option, PROC DTREE uses the specifications in the jth generatedSYMBOL definition and not the specifications in the SYMBOLj statement. Refer to SAS/GRAPHSoftware: Reference for the details about creating, canceling, reviewing, and altering SYMBOLdefinitions.
LINKC=kIf the LINKC=k option is specified, then PROC DTREE uses the type specified with the LINE=option in the kth generated SYMBOL definition to draw all links in the decision tree diagram that arecontinued on subsequent pages. There is no default value for this option. The color and thicknessfor links continued on another page indicate whether the link represents an optimal decision or not.The type specification may be overridden by the specification of the LSTYLEC= option in the PROCDTREE statement.
Note that if you specify the LINKC=k option, PROC DTREE uses the specifications in the kthgenerated SYMBOL definition and not the specifications in the SYMBOLk statement. Refer toSAS/GRAPH Software: Reference for the details about creating, canceling, reviewing, and alteringSYMBOL definitions.
PROC DTREE Statement F 409
LSTYLE=l
L=lspecifies the line type (style) used for drawing all links in the decision tree diagram, except those thatrepresent the optimal decisions and those that are continued on subsequent pages. Valid values for lare 1 through 46. If the LSTYLE= option is not specified, the type specification is determined in thefollowing order:
� the LINE= option in the ith generated SYMBOL definition, if the option LINKA=i is specified
� the default value, 1 (solid line)
LSTYLEB=l2
LB=l2specifies the line type (style) used for drawing the links in the decision tree diagram that representoptimal decisions. Valid values for l2 are 1 through 46. If the LSTYLEB= option is not specified, thetype specification is determined in the following order:
� the LINE= option in the jth generated SYMBOL definition, if the option LINKB=j is specified
� the default value, 1 (solid line)
LSTYLEC=l3
LC=l3specifies the line type (style) used for drawing the links in the decision tree diagram that are continuedon the next subsequent pages. Valid values for l3 are 1 through 46.
If the LSTYLEC= option is not specified, the type specification is determined in the following order:
� the LINE= option in the kth generated SYMBOL definition, if the option LINKC=k is specified
� the default value, 2 (dot line)
LWIDTH=w
LTHICK=wspecifies the line thickness (width) used to draw all links in the decision tree diagram except those thatrepresent the optimal decisions.
If the LWIDTH= option is not specified, the thickness specification is determined in the followingorder:
� the WIDTH= option in the ith generated SYMBOL definition, if the option LINKA=i is specified
� the default value, 1
LWIDTHB=w2
LTHICKB=w2specifies the line thickness (width) used to draw the links in the decision tree diagram that representoptimal decisions. If the LWIDTHB= option is not specified, the thickness specification is determinedin the following order:
� the WIDTH= option in the jth generated SYMBOL definition, if the option LINKB=j is specified
� 2 times the thickness for links that represent regular outcomes
410 F Chapter 7: The DTREE Procedure
NAME=‘string’specifies a descriptive string, up to 8 characters long, that appears in the name field of the master menuof PROC GREPLAY. The default is ‘DTREE ’.
PAGENUM j NOPAGENUM
PAGENUMBER j NOPAGENUMBERspecifies whether the page numbers should be displayed in the top right corner of each page of amultipage decision tree diagram. If the NOPAGENUM is not specified, the pages are ordered from topto bottom, left to right.
The default is PAGENUM.
RC j NORCspecifies whether the links in the decision tree diagram should be drawn with rounded corners or withrectangular corners. The default is RC.
SYMBOLC=m
SYMBC=mIf the SYMBOLC= option is specified, then PROC DTREE uses the color specified with the CV=option, the character specified with the VALUE= option, the font specified with the FONT= option, andthe height specified with the HEIGHT= option in the mth generated SYMBOL definition to draw allchance nodes in the decision tree diagram. There is no default value for this option. The color and thesymbol specifications may be overridden by the specification of the CSYMBOLC= and VSYMBOLC=options in the PROC DTREE statement. The height of the symbol can be changed by the HSYMBOL=option in the PROC DTREE statement.
Note that if you specify the SYMBOLC=m option, PROC DTREE uses the specifications in the mthgenerated SYMBOL definition and not the specifications in the SYMBOLm statement. Refer toSAS/GRAPH Software: Reference for the details about creating, canceling, reviewing, and alteringSYMBOL definitions.
SYMBOLD=d
SYMBD=dIf the SYMBOLD= option is specified, then PROC DTREE uses the color specified with the CV=option, the character specified with the VALUE= option, the font specified with the FONT= option,and the height specified with the HEIGHT= option in the d th generated SYMBOL definition todraw all decision nodes in the decision tree diagram. There is no default value for this option. Thecolor and the symbol specifications may be overridden by the specification of the CSYMBOLD= andVSYMBOLD= options in the PROC DTREE statement. The height of the characters can be changedby the HSYMBOL= option in the PROC DTREE statement.
Note that if you specify the SYMBOLD=d option, PROC DTREE uses the specifications in thed th generated SYMBOL definition and not the specifications in the SYMBOLd statement. Refer toSAS/GRAPH Software: Reference for the details about creating, canceling, reviewing, and alteringSYMBOL definitions.
PROC DTREE Statement F 411
SYMBOLE=n
SYMBE=nIf the SYMBOLE= option is specified, then PROC DTREE uses the color specified with the CV=option, the character specified with the VALUE= option, the font specified with the FONT= option,and the height specified with the HEIGHT= option in the nth generated SYMBOL definition to drawall end nodes in the decision tree diagram. There is no default value for this option. The color and thesymbol specifications may be overridden by the specification of the CSYMBOLE= and VSYMBOLE=options specified in the PROC DTREE statement. The height of the characters can be changed by theHSYMBOL= option in the PROC DTREE statement.
Note that if you specify the SYMBOLE=n option, PROC DTREE uses the specifications in the nthgenerated SYMBOL definition and not the specifications in the SYMBOLn statement. Refer toSAS/GRAPH Software: Reference for the details about creating, canceling, reviewing, and alteringSYMBOL definitions.
VSYMBOLC=symbolc-name
VC=symbolc-namespecifies that the symbol symbolc-name from the special symbol table be used to draw all chancenodes in the decision tree diagram. If you do not specify this option, the symbol used is determined inthe following order:
� the options VALUE= and FONT= specifications in the mth generated SYMBOL definition, if theoption SYMBOLC=m is specified
� the symbol CIRCLE in the special symbol table
VSYMBOLD=symbold-name
VD=symbold-namespecifies that the symbol symbold-name from the special symbol table be used to draw all decisionnodes in the decision tree diagram. If you do not specify this option, the symbol used is determined inthe following order:
� the options VALUE= and FONT= specifications in the d th generated SYMBOL definition, if theoption SYMBOLD=d is specified
� the symbol SQUARE in the special symbol table
VSYMBOLE=symbole-name
VE=symbole-namespecifies that the symbol symbole-name from the special symbol table be used to draw all end nodesin the decision tree diagram. If you do not specify this option, the symbol used is determined in thefollowing order:
� the options VALUE= and FONT= specifications in the nth generated SYMBOL definition, if theoption SYMBOLE=n is specified
� the symbol DOT in the special symbol table
412 F Chapter 7: The DTREE Procedure
Line-Printer Options
The following options are specifically for the purpose of producing line-printer quality decision tree diagram.
FORMCHAR< (syni-list) >= ‘formchar-string’defines characters to be used for features on line-printer plots. The syni-list is a list of numbersranging from 1 to 13. The list identifies which features are controlled with the string characters. Theformchar-string gives characters for features in syni-list . Any character or hexadecimal string can beused. By default, syni-list is omitted, and the FORMCHAR= option gives a string for all 13 features.The features associated with values of syni are listed in Table 7.9. Note that characters 4, 6, 7, 10, and12 are not used in drawing a decision tree diagram.
Table 7.9 Features Associated with the FORMCHAR= Option
Syni Description of Character Feature1 Vertical bar Vertical link2 Horizontal bar Horizontal link3 Box character (upper left) Vertical up to horizontal turn5 Box character (upper right) Horizontal and down vertical joint8 Box character (middle right) Horizontal to split joint9 Box character (lower left) Vertical down to horizontal turn11 Box character (lower right) Horizontal and up vertical joint13 Horizontal thick Horizontal link that represents
optimal decision
As an example, the decision tree diagram in Figure 7.7 is produced by the following statement:
title "Decision Tree Showing the Effects of FORMCHAR";
data Dtoils4;format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_SUCCES_ $12.;input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $ _SUCCES_ $;datalines;
Drill D Drill Cost. . Not_Drill .Cost C Low Oil_Deposit. . High Oil_DepositOil_Deposit C Dry .. . Wet .;
proc dtree stagein=Dtoils4nowarning;
treeplot / formchar(1 2 3 5 8 9 11 13)='|-/*<\+='lineprinter display=(LINK);
quit;
EVALUATE Statement F 413
Figure 7.7 Decision Tree Showing the Effects of FORMCHAR
Decision Tree Showing the Effects of FORMCHAR
The DTREE Procedure
Line-printer Plot
Decision Tree Showing the Effects of FORMCHAR
The DTREE Procedure
Line-printer Plot
Low Dry /----------C-*----------E Drill | | Wet /----------C-< \----------E | | High Dry ----------D-< \----------C-*----------E | | Wet | \----------E |Not_Drill \----------E
By default, the form character list specified with the SAS system option FORMCHAR= is used;otherwise, the default is '|----|+|---+='. Refer to the chapter on the Calendar Procedure in theSAS Procedures Guide for more information.
EVALUATE StatementEVALUATE / options ;
The EVALUATE statement causes PROC DTREE to evaluate the decision tree and calculate the optimaldecisions. If the SUMMARY option is specified a decision summary is displayed. Otherwise, the currentoptimal value is displayed on the SAS log.
The following options, which can appear in the PROC DTREE statement, can also be specified in theEVALUATE statement:
CRITERION=i MAXPREC=d MAXWIDTH=mwNOSUMMARY NWIDTH=nw RT=rSUMMARY TARGET=stage
The MAXPREC=, MAXWIDTH=, and NWIDTH=, options are valid only in conjunction with the SUM-MARY option. The RT= option is valid only in conjunction with the CRITERION=MAXCE or CRITE-RION=MINCE specification. The options specified in this statement are only in effect for this statement.
MODIFY StatementMODIFY outcome-name REWARD new-value ;
MODIFY stage-name TYPE ;
The MODIFY statement is used to change either the type of a stage or the reward from an outcome. IfMODIFY outcome-name REWARD new-value is given where the outcome-name is an outcome specifiedin the STAGEIN= data set, and new-value is a numeric value, then the reward of the outcome namedoutcome-name is changed to new-value.
414 F Chapter 7: The DTREE Procedure
If MODIFY stage-name TYPE is given where stage-name is a stage name specified in the STAGEIN= dataset, then the type of the stage named stage-name is changed to 'DECISION' if its current type is 'CHANCE'and is changed to 'CHANCE' if its current type is 'DECISION'. You cannot change the type of an 'END' stage.The change of the type of a stage from 'CHANCE' to 'DECISION' can help the decision-maker learn howmuch improvement can be expected if he or she could pick which of the future (or unknown) outcomes wouldoccur. However, if you want to change the type of a stage from 'DECISION' to 'CHANCE', the procedure isnot able to determine the probabilities for its outcomes unless you specify them in the PROBIN= data set.
MOVE StatementMOVE stage1 (BEFORE | AFTER) stage2 ;
The MOVE statement is used to change the order of the stages. After all data in input data sets have been read,PROC DTREE determines the order (from left to right) of all stages specified in the STAGEIN= data set anddisplay the order in the SAS log. The ordering is determined based on the rule that if stage A is the successorof an outcome of stage B, then stage A should occur to the right of stage B. The MOVE statement can be usedto change the order. If the keyword BEFORE is used, stage1 becomes the new successor for all immediatepredecessors of stage2, and stage2 becomes the new successor for all outcomes of stage1. An outcome issaid to be an immediate predecessor of a stage if the stage is the successor of that outcome. Similarly, if thekeyword AFTER is used, the old leftmost (in previous order) successor of outcomes for stage2 becomes thenew successor for all outcomes of stage1 and the new successor of all outcomes of stage2 is stage1.
There are two limitations: the END stage cannot be moved, and no stage can be moved after the END stage.In practice, any stage after the END stage is useless.
QUIT StatementQUIT ;
The QUIT statement tells the DTREE procedure to terminate processing. This statement has no options.
RECALL StatementRECALL ;
This statement tells PROC DTREE to recall the decision model that was saved previously with a SAVEstatement. The RECALL statement has no options.
RESET StatementRESET options ;
The RESET statement is used to change options after the procedure has started. All of the options that canbe set in the PROC DTREE statement can also be reset with this statement, except for the STAGEIN=, thePROBIN=, and the PAYOFFS= data set options.
SAVE Statement F 415
SAVE StatementSAVE ;
The SAVE statement saves the current model (attributes of stages and outcomes, the ordering of stages, andso on) to a scratch space from which you can call it back later. It is a good idea to save your decision modelbefore you specify any MOVE or MODIFY statements. Then you can get back to your original model easilyafter a series ofstatements that change the decision model. The SAVE statement has no options.
SUMMARY StatementSUMMARY / options ;
Unlike the SUMMARY option on the PROC DTREE statement or the EVALUATE statement, which specifiesthat PROC DTREE display a decision summary when the decision tree is evaluated, the SUMMARYstatement causes the procedure to display the summary immediately. If the decision tree has not beenevaluated yet, or if it has been changed (by the MOVE, MODIFY, or RECALL statement) since lastevaluated, the procedure evaluates or re-evaluates the decision tree before the summary is displayed.
The following options that can appear in the PROC DTREE statement can also be specified in this statement:
MAXPREC=d MAXWIDTH=mwNWIDTH=nw TARGET=stage
The options specified in this statement are in effect only for this statement.
TREEPLOT StatementTREEPLOT / options ;
The TREEPLOT statement plots the current decision tree (a diagram of the decision problem). Each pathin the decision tree represents a possible scenario of the problem. In addition to the nodes and links on thedecision tree, the information for each link that can be displayed on the diagram is listed in Table 7.10.
Table 7.10 Information on Decision Tree Diagram
Information Labeled byStage name for the successor of the link NL3
Outcome name for the link NL3
Probability of the outcome p=Value can be expected from the successor EV=Instant reward of the outcome r=Cumulative rewards of outcomes on the path that leads to the successor cr=
3NL denotes that this information is not labeled.
416 F Chapter 7: The DTREE Procedure
If necessary, the outcome names and the stage names are displayed above the link, and other information (ifthere is any) is displayed below the link. The DISPLAY= option can be used to control which informationshould be included in the diagram. The NOLABEL can be used to suppress the displaying of the labels.
If the LINEPRINTER option is used, the decision nodes, chance nodes, and the end nodes are representedby the characters ‘D’, ‘C’, and ‘E’, respectively. The links are displayed using the specifications of theFORMCHAR= option. See the section “PROC DTREE Statement” on page 401 for more details. In graphicsmode, the control of the appearances of nodes and links is more complex. See the section “Displaying theDecision Tree” on page 429 for more information.
The following options that can appear in the PROC DTREE statement can also be specified in the TREEPLOTstatement:
DISPLAY=(information-list) GRAPHICS LABELLINEPRINTER MAXPREC=d MAXWIDTH=mwNOLABEL NWIDTH=nw YBETWEEN=ybetween <units>
The following line-printer options that can appear in the PROC DTREE statement can also be specified in theTREEPLOT statement if the LINEPRINTER option is specified:
FORMCHAR<(syni-list)>=‘formchar-string’
Moreover, the following graphics options that can appear in the PROC DTREE statement can also be specifiedin the TREEPLOT statement if the GRAPHICS option is specified:
ANNOTATE=SAS-data-set CBEST=color CLINK=colorCOMPRESS CSYMBOLC=color CSYMBOLD=colorCSYMBOLE=color CTEXT=color DESCRIPTION=‘string’DOANNOTATE FTEXT=name GOUT=SAS-catalogHSYMBOL=h HTEXT=h IMAGEMAP=SAS-data-setLEGEND LINKA=i LINKB=jLINKC=k LSTYLE=l LSTYLEB=l2LSTYLEC=l3 LWIDTH=w2 LWIDTHB=w2NAME=‘string’ NOANNOTATE NOCOMPRESSNOLEGEND NOPAGENUM NORCPAGENUM RC SYMBOLC=mSYMBOLD=d SYMBOLE=n VSYMBOLC=symbolc-nameVSYMBOLD=symbold-name VSYMBOLE=symbole-name
The options specified in this statement are in effect only for this statement, and they may override the optionsspecified in the PROC DTREE statement.
VARIABLES StatementVARIABLES / options ;
The VARIABLES statement specifies the variable lists in the input data sets. This statement is optional but ifit is used, it must appear immediately after the PROC DTREE statement. The options that can appear in the
VARIABLES Statement F 417
VARIABLES statement are divided into groups according to the data set in which they occur. Table 7.11 listsall the variables or variable lists associated with each input data set and their types. It also lists the defaultvariables if they are not specified in this statement.
Table 7.11 Input Data Sets and Their Associated Variables
Data Set Variable Type4 Interpretation DefaultSTAGEIN= OUTCOME= C/N Outcome names Variables with prefix _OUT
REWARD= N Instant reward Variables with prefix _REWSTAGE= C/N Stage name _STNAME_SUCCESSOR= as STAGE= Immediate successors Variables with prefix _SUCCTYPE= C/N Stage type _STTYPE_WEB= C HTML page for the stage
PROBIN= EVENT= as OUTCOME= Event names Variables with prefix _EVENGIVEN= as OUTCOME= Names of given outcomes Variables with prefix _GIVEPROB= N Conditional probabilities Variables with prefix _PROB
PAYOFFS= ACTION= as OUTCOME= Action names of final decision Variables with prefix _ACTSTATE= as OUTCOME= Outcome names Variables with prefix _STATVALUE= N Values of the scenario Variables with prefix _VALU
4‘C’ denotes character, ‘N’ denotes numeric, ‘C/N’ denotes character or numeric, and ‘as X’ denotes the same as variable X.
Variables in STAGEIN= Data Set
The following options specify the variables or variable lists in the STAGEIN= input data set that identify thestage name, its type, its outcomes, and the reward; and the immediate successor of each outcome for eachstage in the decision model:
OUTCOME=(variables)identifies all variables in the STAGEIN= data set that contain the outcome names of the stage specifiedby the STAGE= variable. If the OUTCOME= option is not specified, PROC DTREE looks for thedefault variable names that have the prefix _OUT in the data set. It is necessary to have at leastone OUTCOME= variable in the STAGEIN= data set. The OUTCOME= variables can be either allcharacter or all numeric. You cannot mix character and numeric variables as outcomes.
REWARD=(variables)
COST=(variables)identifies all variables in the STAGEIN= data set that contain the reward for each outcome specified bythe OUTCOME= variables. If the REWARD= option is not specified, PROC DTREE looks for thedefault variable names that have the prefix _REW in the data set. The number of REWARD= variablesmust be equal to the number of OUTCOME= variables in the data set. The REWARD= variables musthave numeric values.
STAGE=variablespecifies the variable in the STAGEIN= data set that names the stages in the decision model. If theSTAGE= option is omitted, PROC DTREE looks for the default variable named _STNAME_ in thedata set. The STAGE= variable must be specified if the data set does not contain a variable named_STNAME_. The STAGE= variable can be either character or numeric.
418 F Chapter 7: The DTREE Procedure
SUCCESSOR=(variables)SUCC=(variables)
identifies all variables in the STAGEIN= data set that contain the names of immediate successors(another stage) of each outcome specified by the OUTCOME= variables. These variables must be ofthe same type and length as those defined in the STAGE= option. If the SUCCESSOR= option is notspecified, PROC DTREE looks for the default variable names that have the prefix _SUCC in the dataset. The number of SUCCESSOR= variables must be equal to the number of OUTCOME= variables.The values of SUCCESSOR= variables must be stage names (values of STAGE= variables in the samedata set).
TYPE=variableidentifies the variable in the STAGEIN= data set that contains the type identifier of the stage specifiedby the STAGE= variable. If the TYPE= option is omitted, PROC DTREE looks for the default variablenamed _STTYPE_ in the data set. The TYPE= variable must be specified if the data set does notcontain a variable named _STTYPE_. The STAGE= variable can be either character or numeric.
The following are valid values for the TYPE= variable.
Value DescriptionDECISION or D or 1 Identifies the stage as a decision stageCHANCE or C or 2 Identifies the stage as an uncertain stageEND or E or 3 Identifies the stage as an end stage
It is not necessary to specify an end stage in the STAGEIN= data set.
WEB=variable
HTML=variablespecifies the character variable in the STAGEIN= data set that identifies an HTML page for each stage.The procedure generates an HTML image map using this information for all the decision tree nodescorresponding to a stage.
Variables in PROBIN= Data Set
The following options specify the variables or variable lists in the PROBIN= input data set that identify thegiven outcome names, the event (outcome) name, and the conditional probability for each outcome of achance stage.
EVENT=(variables)identifies all variables in the PROBIN= data set that contain the names of events (outcomes) thatprobabilities depend on the outcomes specified by the GIVEN= variables. If the EVENT= option isnot specified, PROC DTREE looks for the default variable names that have the prefix _EVEN in thedata set. You must have at least one EVENT= variable in the PROB= data set. The values of EVENT=variables must be outcome names that are specified in the STAGEIN= data set.
GIVEN=(variables)identifies all variables in the PROBIN= data set that contain the given condition (a list of outcomenames) of a chance stage on which the probabilities of the outcome depend. If the GIVEN= option isnot specified, PROC DTREE looks for the default variable names that have the prefix _GIVE in thedata set. It is not necessary to have GIVEN= variables in the data set but if there are any, their valuesmust be outcome names that are specified in the STAGEIN= data set.
VPC Statement F 419
PROB=(variables)identifies all variables in the PROBIN= data set that contain the values of the conditional probabilityof each event specified by the EVENT= variables, given that the outcomes specified by the GIVEN=variables have occurred. If the PROB= option is not specified, PROC DTREE looks for the defaultvariable names that have the prefix _PROB in the data set. The number of PROB= variables in thedata set must be equal to the number of EVENT= variables. The PROB= variables must have numericvalues between 0 and 1 inclusive.
Variables in PAYOFFS= Data Set
The following options specify the variables or variable lists in the PAYOFFS= input data set that identify thepossible scenarios (a sequence of outcomes), the final outcome names, and the evaluating values (payoff) ofcombinations of scenarios and final outcomes.
ACTION=(variables)identifies all variables in the PAYOFFS= data set that contain the name of the final outcome for eachpossible scenario. If the ACTION= option is not specified, PROC DTREE looks for the default variablenames that have the prefix _ACT in the data set. It is not necessary to have any ACTION= variablesin the PAYOFFS= data set, but if there are any, their values must be outcome names specified in theSTAGEIN= data set.
STATE=(variables)identifies all variables in the PAYOFFS= data set that contain the names of outcomes that identify apossible scenario (a sequence of outcomes or a path in the decision tree), or the names of outcomeswhich combine with every outcome specified by the ACTION= variables to identify a possible scenario.If the STATE= option is not specified, PROC DTREE looks for the default variable names that have theprefix _STAT in the data set. It is not necessary to have any STATE= variables in the PAYOFFS= dataset, but if there are any, their values must be outcome names specified in the STAGEIN= data set.
VALUE=(variables)PAYOFFS=(variables)UTILITY=(variables)LOSS=(variables)
identifies all variables in the PAYOFFS= data set that contain the evaluating values or payoffs for allpossible scenarios identified by the outcomes specified by the STATE= variables and the outcomesspecified by the associated ACTION= variables. If the VALUE= option is not specified, PROC DTREElooks for the default variable names that have the prefix _VALU in the data set. The number of VALUE=variables must be equal to the number of ACTION= variables if there are any ACTION= variables. Ifthere are no ACTION= variables in the data set, at least one STATE= variable must be in the data set,and the number of VALUE= variables must be exactly 1. The VALUE= variables must have numericvalues.
VPC StatementVPC chance-stage-name ;
The VPC statement causes PROC TREE to compute the value of perfect control (the value of controlling anuncertainty). The effect of perfect control is that you can pick the outcome of an uncertain stage. This value
420 F Chapter 7: The DTREE Procedure
gives an upper limit on the amount you should be willing to spend on any control procedure. Only the nameof a chance stage can be used to calculate the value of perfect control. The procedure evaluates the decisiontree, if it has not already done so, before computing this value.
VPI StatementVPI chance-stage-name ;
The VPI statement causes PROC DTREE to compute the value of perfect information. The value of perfectinformation is the benefit of resolving an uncertain stage before making a decision. This value is the upperlimit on the improvement that can be expected for any information gathering effort. Only the name of achance stage can be used to calculate the value of perfect information. The procedure evaluates the decisiontree, if it has not already done so, before computing this value.
Details: DTREE Procedure
Input Data SetsA decision problem is normally constructed in three steps:
1. A structuring of the problem in terms of decisions, uncertainties, and consequences.
2. Assessment of probabilities for the events.
3. Assessment of values (payoffs, losses, or preferences) for each consequence or scenario.
PROC DTREE represents these three steps in three SAS data sets. The STAGEIN= data set describes thestructure of the problem. In this data set, you define all decisions and define all key uncertainties. Thisdata set also contains the relative order of when decisions are made and uncertainties are resolved (planninghorizon). The PROBIN= data set assigns probabilities for the uncertain events, and the PAYOFFS= dataset contains the values (or utility measure) for each consequence or scenario. See the section “Overview:DTREE Procedure” on page 384 and the section “Getting Started: DTREE Procedure” on page 385 for adescription of these three data sets.
PROC DTREE is designed to minimize the rules for describing a problem. For example, the PROBIN= dataset is required only when the evaluation and analysis of a decision problem is necessary. Similarly, if thePAYOFFS= data set is not specified, the DTREE procedure assumes all payoff values are 0. The order of theobservations is not important in any of the input data sets. Since a decision problem can be structured in manydifferent ways and the data format is so flexible, all possible ways of describing a given decision problemcannot be shown here. However, some alternate ways of supplying the same problem are demonstrated. Forexample, the following statements show another way to input the oil wildcatter’s problem described in thesection “Introductory Example” on page 385.
Input Data Sets F 421
data Dtoils3;format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_REWARD_ dollar12.0 _SUCCES_ $12.;input _STNAME_ $12. _STTYPE_ $4. _OUTCOM_ $12.
_REWARD_ dollar12.0 _SUCCES_ $12.;datalines;
Drill D Drill . Cost. . Not_drill . .Cost C Low -$150,000 Oil_deposit. . Fair -$300,000 Oil_deposit. . High -$500,000 Oil_depositOil_deposit C Dry . .. . Wet $700,000 .. . Soaking $1,200,000 .;
/* -- create PAYOFFS= data set -- */data Dtoilp3;
input _EVENT1 $ _PROB1 _EVENT2 $ _PROB2;datalines;
Low 0.2 Dry 0.5Fair 0.6 Wet 0.3High 0.2 Soaking 0.2;
/* -- PROC DTREE statements -- */title "Oil Wildcatter's Problem";proc dtree stagein=Dtoils3
probin=Dtoilp3nowarning;
evaluate / summary;
Note that the STAGEIN= data set describes the problem structure and the payoffs (using the REWARD=variable). Thus, the PAYOFFS= data set is no longer needed. Note also the changes made to the PROBIN=data set. The results, shown in Figure 7.8, are the same as those shown in Figure 7.2. However, the rewardsand the payoffs are entirely different entities in decision tree models. Recall that the reward of an outcomemeans the instant returns when the outcome is realized. On the other hand, the payoffs are the return fromeach scenario. In the other words, the decision tree model described in the previous code and the modeldescribed in the section “Introductory Example” on page 385 are not equivalent, even though they have thesame optimal decision.
422 F Chapter 7: The DTREE Procedure
Figure 7.8 Optimal Decision Summary of the Oil Wildcatter’s Problem
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Drill Decision
Cost Chance
Oil_deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 140000
Optimal Decision Policy
Up to Stage Drill
Alternativesor
OutcomesCumulative
RewardEvaluating
Value
Drill $0 140000*
Not_drill $0 0
You can try many alternative ways to specify your decision problem. Then you can choose the model that ismost convenient and closest to your real problem. If PROC DTREE cannot interpret the input data, it writesa message to that effect to the SAS log unless the NOWARNING option is specified. However, there aremistakes that PROC DTREE cannot detect. These often occur after the model has been modified with eitherthe MOVE statement or the MODIFY statement. After a MOVE statement is specified, it is a good idea todisplay the decision tree (using the TREEPLOT statement) and check the probabilities and value assessmentsto make sure they are reasonable.
For example, using the REWARD= variable in the STAGEIN= data set to input the payoff information asshown in the previous code may cause problems if you change the order of the stages. Suppose you movethe stage 'Cost' to the beginning of the tree, as was done in the section “Sensitivity Analysis and Value ofPerfect Information” on page 391:
move Cost before Drill;evaluate / summary;
The optimal decision yields $140,000, as shown on the optimal decision summary in Figure 7.9.
Missing Values F 423
Figure 7.9 Optimal Decision Summary of the Oil Wildcatter’s Problem
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Cost Chance
Drill Decision
Oil_deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 140000
Optimal Decision Policy
Up to Stage Drill
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Low Drill $-150,000 450000*
Low Not_drill $-150,000 0
Fair Drill $-300,000 450000*
Fair Not_drill $-300,000 0
High Drill $-500,000 450000*
High Not_drill $-500,000 0
Recall that when this was done in the section “Sensitivity Analysis and Value of Perfect Information” onpage 391, the optimal decision yielded $150,000. The reason for this discrepancy is that the cost of drilling,implemented as (negative) instant rewards here, is imposed on all scenarios including those that contain theoutcome 'Not_drill'. This mistake can be observed easily from the Cumulative Reward column of theoptimal decision summary shown Figure 7.9.
Changing a decision stage to a chance stage is another example where using the MODIFY statement withoutcare may cause problems. PROC DTREE cannot determine the probabilities of outcomes for this new chancestage unless they are included in the PROBIN= data set. In contrast to changing a chance stage to a decisionstage (which yields insight on the value of gaining control of an uncertainty), changing a decision stage to achance stage is not likely to yield any valuable insight even if the needed probability data are included in thePROBIN= data set, and it should be avoided.
Missing ValuesIn the STAGEIN= data set, missing values are allowed only for the STAGE= and TYPE= variables whenthe information of a stage is specified in more than one observation. In this case, missing values for theSTAGE= and TYPE= variables are not allowed for the first observation defining the stage. Missing values forthe OUTCOME=, GIVEN=, EVENT=, STATE=, and ACTION= variables are ignored. Missing values for
424 F Chapter 7: The DTREE Procedure
the REWARD=, PROB=, and VALUE= variables are treated as 0. Missing values for the SUCCESSOR=variables are ignored if the value for the corresponding OUTCOME= variable is also missing.
InteractivityThe DTREE procedure is interactive. You start the procedure with the PROC DTREE statement and terminateit with the QUIT statement. It is not necessary to have a VARIABLES statement, although if you do includeone, it must appear immediately after the PROC DTREE statement. The other statements such as theEVALUATE, MODIFY, MOVE, RECALL, RESET, SAVE, SUMMARY, TREEPLOT, VPC, and VPI, aswell as the FOOTNOTE, GOPTIONS, NOTE, SYMBOL, and TITLE statements of SAS/GRAPH Softwarecan be used in any order and as often as needed. One exception is that the RECALL statement has to bepreceded by at least one SAVE statement.
When an error is detected during processing a statement other than the PROC DTREE statement and theQUIT statement, the procedure terminates if the option ERRHANDLE=QUIT is specified; otherwise it stopsprocessing the current statement and waits for the next statement. In either case, an error message is writtento the SAS log. If an error is detected in the PROC DTREE statement or the QUIT statement, the procedureterminates immediately with an error message.
Options in Multiple StatementsMany options that can be specified in the PROC DTREE statement can also appear in other statements.The options specified in the PROC DTREE statement remain in effect for all statements until the end ofprocessing or until they are changed by a RESET statement. In this sense, those options are global options.The options specified in other statements are in effect only for the statement in which they are specified;hence, they are local options. If an option is specified both in the PROC DTREE statement and in anotherstatement, the local specification overrides the global specification.
For example, the following statements
reset criterion=maxev;evaluate / criterion=maxce rt=700000;summary;
imply that the decision problem is evaluated and the optimal decision is determined based on the criterionMAXCE with RT=700000. However, the optimal decision summary produced by the SUMMARY statementis based on the option CRITERION=MAXEV and not the MAXCE criterion. If you want an option to be setpermanently, use the RESET statement.
The Order of StagesThe order of stages is an important issue in structuring the decision problem. This sets the sequence of eventsor a time horizon and determines when a decision has to be made and when a chance stage has its uncertaintyresolved. If a decision stage precedes another decision stage in the stages order, the decision to the right ismade after the decision to the left. Moreover, the choice made in the first decision is remembered by the
Evaluation F 425
decision maker when he or she makes the second decision. Any chance stages that occur to the left of adecision stage have their uncertainty resolved before the decision is made. In other words, the decision makerknows what actually happened when he or she makes the decision. However, the order of two chance stagesis fairly arbitrary if there are no other decision stages between them. For example, you can change the orderof stages 'Cost' and 'Oil_Deposit' in the oil wildcatter’s problem without affecting the results.
PROC DTREE determines the order (from left to right) of all stages specified in the STAGEIN= data set.The ordering is based on the rule that if stage A is the successor of an outcome of stage B, then stage A
should occur to the right of (or after) stage B. With the MOVE statement, you can change this order. TheMOVE statement is very useful in determining the value (benefit or penalty) of postponing or hurrying adecision. In particular, the value of perfect information about an uncertainty can be determined by movingthe corresponding chance stage to the beginning. However, as mentioned in early sections, the results may bemisleading if you use the MOVE statement without care. See the section “Input Data Sets” on page 420 foran example.
Suggestions for preventing misleading results are as follows:
� Using the SAVE statement, always save the original structure before making any changes.
� Use the TREEPLOT statement to display the complete decision tree and check all details after youchange the order.
EvaluationThe EVALUATE statement causes PROC DTREE to calculate the optimal decision. The evaluate process isdone by successive use of two devices:
� Find a certain equivalent for the uncertain evaluating values at each chance node.
� Choose the best alternative at each decision node.
The certain equivalent of an uncertainty is the certain amount you would accept in exchange for the uncertainventure. In other words, it is a single number that characterizes an uncertainty described by a probabilitydistribution. This value is subjective and can vary widely from person to person. There are two quantities,closely related to the certain equivalent, that are commonly used by decision-makers: the most likely valueand the expected value. The most likely value of an uncertainty is the value with the largest probability. Theexpected value is the sum of all outcomes multiplied by their probabilities.
Perhaps the most popular way to find the certain equivalent for an uncertainty is the use of utility function orutility curve. Utility is a measurement of relative preference to the decision maker for particular outcomes.The utility function assigns a utility to payoff when it is in terms of continuous values such as money. Thecertain equivalent of an uncertainty (a random variable) is calculated by the following steps:
1. Use the utility function or the utility curve to find the utility values of the outcomes.
2. Calculate the expected utility of the uncertainty.
426 F Chapter 7: The DTREE Procedure
3. Determine the certain equivalent of the uncertainty as the value that corresponding utility value is theexpected utility.
Refer to Raiffa (1970) for a complete discussion of the utility function.
A simple case that is commonly used is the straight line utility curve or the linear utility function. The linearutility function has the form
u.x/ D aC bx
where x is the evaluating value, and a and b are parameters set by the choice of two points in the utility curve.For example, if the utility curve passes two points u.0/ D 0 and u.1000/ D 1, then parameters a and b areset by a = 0 and b = 1 / 1000. The certain equivalent of an uncertainty based on this function is the expectedvalue.
Another special case that is commonly used is the exponential utility function, as
u.x/ D a � b � exp.�x=r/
where, again, a and b can be set by the choice of two arbitrary points in the utility curve. For example, ifyour utility curve goes through points (0,0) and (1000,1), then a and b are given by
a D b D 1=Œ1 � exp.�1000=r/�
If an uncertain venture A has n events, event i having probability pi and payoff xi , and if the utility functionis an exponential function as in the preceding example, then the certain equivalent of A is
CE.A/ D �r ln
"nX
iD1
pi exp.�xi=r/
#
and is independent of the choice of values for a and b (provided that b > 0) (Raiffa 1970).
The parameter r, called the risk tolerance, describes the curvature of the utility function. Moreover, thequantity 1=r , called risk aversion coefficient (Howard 1968) is a measure of risk aversion.
Experimental results show that within a reasonable range of values, many utility curves can be fit quite wellby an exponential function.
If your utility function is an exponential function as in the preceding example, the risk tolerance can beestimated by the largest number R for which the following venture is still acceptable to you.
Evaluation F 427
0.5
R
0.5
�R=2
A similar way to approximate the risk tolerance is to find the largest value R for which the venture isacceptable (Howard 1988).
0.75
R
0.25
�R
For corporate decision making, there are some rules of thumb for estimating the risk tolerance. Examples areto set risk tolerance about equal to one of the following:
� net income of the company
� one sixth of equity
� six percent of net sales
To reveal how well these rules perform in assessing corporate risk tolerance, Howard (1988) provided thefollowing two tables: Table 7.12 shows the relationship between the risk tolerance and financial measures offour large oil and chemicals companies. There, the risk tolerances are obtained from the top executives of thecompanies. The net sales, net income, and equity are obtained from the annual reports of the four companies.
428 F Chapter 7: The DTREE Procedure
Table 7.12 Relating Corporate Risk Tolerance to Financial Measures
Measure Company($ millions) A B C DNet Sales 2,300 3,307 16,000 31,000Net Income 120 152 700 1,900Equity 1,000 1,153 6,500 12,000Risk Tolerance 150 200 1,000 2,000
Table 7.13 shows the ratio of risk tolerance to each of the other quantities.
Table 7.13 Ratios of Corporate Risk Tolerance to Financial Measures
CompanyMeasure A B C D AverageRT/Sales 0.0652 0.0605 0.0625 0.0645 0.0632RT/Income 1.25 1.32 1.43 1.05 1.26RT/Equity 0.150 0.174 0.154 0.167 0.161
Once the certain equivalents for all chance nodes are assessed, the choice process at each decision nodeis fairly simple; select the alternative yielding either the maximum or the minimum (depending on theproblem) future certain equivalent value.� You can use the CRITERION= option to control the way thecertain equivalent is calculated for each chance node and the optimal alternative is chosen at each decisionnode. Possible values for the CRITERION= option are listed in Table 7.5. If you use an exponential utilityfunction, the RT= option can be used to specify your risk tolerance. You also have control over how to presentthe solution. By default, PROC DTREE writes the value of the optimal decisions to the SAS log. In addition,with the SUMMARY option, you can ask PROC DTREE to display the optimal decision summary to theoutput.
Displayed OutputThe SUMMARY statement and the SUMMARY option in an EVALUATE statement cause PROC DTREE todisplay a optimal decision summary for the decision model. This output is organized into various tables, andthey are discussed in order of appearance.
1The future certain equivalent value is often referred to as the evaluating value in this documentation.
Displaying the Decision Tree F 429
Order of stages
The Order of stages table lists all stages, and their types, in order of appearance in the decision model. Seethe section “The Order of Stages” on page 424 for details.
For ODS purposes, the label of the Order of stages table is “Stages.”
Decision Parameters
The Decision Parameters table describes the criterion used for determining the optimal decision and thecertain equivalent for replacing uncertainties. If you specify the option CRITERION=MAXCE or CRITE-RION=MINCE in the PROC DTREE statement or in the EVALUATE statement, an additional row is addedto the table listing the value of the risk tolerance. It also contains a row showing the value of the optimaldecision yields. For additional information, see the section “Evaluation” on page 425.
For ODS purposes, the label of the Decision Parameters table is “Parameters.”
Optimal Decision Policy
By default, PROC DTREE produces an Optimal Decision Policy table for each decision stage. You can use theTARGET= option to force PROC DTREE to produce only one table for a particular stage. The Alternativesor Outcomes columns list the events in the scenario that leads to the current stage. The Cumulative Rewardcolumn lists the rewards accumulated along the scenario to the events of the current target stage. TheEvaluating Value column lists the values that can be expected form the events of the target stage. An asterisk(*) is placed beside an evaluating value indicates the current event is the best alternative of the given scenario.
For ODS purposes, the label of the Optimal Decision Policy table is “Policy.”
Displaying the Decision TreePROC DTREE draws the decision tree either in line-printer mode or in graphics mode. However, you needto have SAS/GRAPH software licensed at your site to use graphics mode. In many cases, the proceduredraws the decision tree across page boundaries. If the decision tree diagram is drawn on multiple pages, theprocedure numbers each page of the diagram on the upper right corner of the page (unless the NOPAGENUMoption 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 allthe pieces together to form one picture, they should be arranged as shown in Figure 7.10.
430 F Chapter 7: The DTREE Procedure
Figure 7.10 Page Layout of the Decision Tree Diagram
1
2
3
4
5
6
7
8
9
10
11
12
The number of pages that are produced depends on the size of the tree and on the number of print positionsthat are available in the horizontal and vertical directions. Table 7.14 lists all options you can use to controlthe number of pages.
Table 7.14 Options That Control the Number of Pages
Option EffectDISPLAY= Amounts of information displayed on the diagramMAXPREC= Maximum decimal width allowed (the precision) to format
numerical values into w:d formatMAXWIDTH= Maximum field width allowed to format numerical valuesNOLABEL No labels are displayed on the diagramNWIDTH= Maximum field width allowed to format outcome namesYBETWEEN= 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:
� The COMPRESS option draws the entire decision tree on one page.
� The HSYMBOL= option controls the height of all symbols.
� The HTEXT= option controls the height of text in the tree.
� The HEIGHT= option in a SYMBOL definition specifies the height of a symbol.
� The HTEXT= option in a GOPTIONS statement specifies the height of all text.
� The HTITLE= option in a GOPTIONS statement specifies the height of the first title line.
� The HPOS= and VPOS= options in a GOPTIONS statement change the number of rows and columns.
Displaying the Decision Tree F 431
The font used for all text can 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 theappearance of the links and the junctions of the diagram. When you specify the GRAPHICS option, severaloptions are available to enhance the appearance of the decision tree diagram. These are described in thesection “Graphics Options” on page 405. In addition, many other options are available in the GOPTIONS andSYMBOL statements for controlling the details of graphics output. See the relevant chapters in SAS/GRAPHSoftware: Reference for a detailed discussion of the GOPTIONS and SYMBOL statements. ODS graphicalstyles can be applied to the decision tree diagram; see the section “ODS Style Templates” on page 434 formore information.
Table 7.15, Table 7.16, and Table 7.17 show the relationship among the options for controlling the appearanceof texts, nodes, and links, respectively. The order that PROC DTREE uses in determining which option is ineffect is also provided. The order assumes that the GSTYLE system option is in effect; if that is not the case,then the steps that refer to ODS style templates are ignored. Names with arguments indicate style elementsand attributes of the current ODS style template. For example, “GraphDataText(‘Font’)” refers to the Fontattribute of the GraphDataText element.
For ODS purposes, the label of the decision tree diagram drawn in line-printer quality is “Treeplot.”
Table 7.15 Options That Control Text AppearanceObject Specification Search OrderText Font 1. The FTEXT= option
2. The FTEXT= option in a GOPTIONS statement3. GraphDataText(‘Font’)4. Hardware font
Color 1. The CTEXT= option2. The CTEXT= option in a GOPTIONS statement3. GraphDataText(‘ContrastColor’)4. The first color in the colors list
Height 1. The value of the HTEXT= option1 times the value of theHTEXT= option2 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 7.16 Options That Control Node AppearanceObject Specification Search OrderChance Symbol 1. The VSYMBOLC= optionNodes 2. The VALUE= and FONT= options in the mth generated
SYMBOL definition, if SYMBOLC=m is specified3. The default symbol, CIRCLE
Color 1. The CSYMBOLC= option2. The CV= option in the mth generated SYMBOL definition,
if SYMBOLC=m is specified3. The CSYMBOL= option in a GOPTIONS statement4. GraphData1(‘ContrastColor’)5. The fifth color in the colors list
432 F Chapter 7: The DTREE Procedure
Table 7.16 (continued)Object Specification Search Order
Height 1. h times the value of the HEIGHT= option in the mth gen-erated SYMBOL definition, if both HSYMBOL=h andSYMBOLC=m are specified
2. The HSYMBOL= option, if it is specified3. The HEIGHT= option in the mth generated symbol defini-
tion, if SYMBOLC=m is specified4. The default value, 1 cell
Decision Symbol 1. The VSYMBOLD= optionNodes 2. The VALUE= and FONT= options in the d th generated
SYMBOL definition, if SYMBOLD=d is specified3. The default value, SQUARE
Color 1. The CSYMBOLD= option2. The CV= option in the d th generated SYMBOL definition,
if SYMBOLD=d is specified3. The CSYMBOL= option in a GOPTIONS statement4. GraphData5(‘ContrastColor’)5. The fourth color in the colors list
Height 1. h times the value of the HEIGHT= option in the d th gen-erated SYMBOL definition, if both HSYMBOL=h andSYMBOLD=d are specified
2. The HSYMBOL= option, if it is specified3. The HEIGHT= option in the d th generated symbol defini-
tion, if SYMBOLD=d is specified4. The default value, 1 cell
End Symbol 1. The VSYMBOLE= optionNodes 2. The VALUE= and FONT= options in the nth generated
SYMBOL definition, if SYMBOLE=n is specified3. The default value, DOT
Color 1. The CSYMBOLE= option2. The CV= option in the nth generated SYMBOL definition
if the option SYMBOLE=n is specified3. The CSYMBOL= option in a GOPTIONS statement4. GraphData8(‘ContrastColor’)5. The sixth color in the colors list
Height 1. h times the value of the HEIGHT= option in the nth gen-erated SYMBOL definition, if both HSYMBOL=h andSYMBOLE=n are specified
2. The HSYMBOL= option, if it is specified3. The HEIGHT= option in the nth generated symbol defini-
tion, if SYMBOLE=n is specified4. The default value, 1 cell
Web-Enabled Decision Tree F 433
Table 7.17 Options That Control Link AppearanceObject Specification Search OrderLinks Type 1. The LSTYLE= optionfor 2. The LINE= option in the ith generated SYMBOLRegular definition, if LINKA=i is specifiedOutcomes 3. The default value, 1 (solid line)
Color 1. The CLINK= option2. The CI= option in the ith generated SYMBOL definition,
if LINKA=i is specified3. GraphData3(‘ContrastColor’)4. The third color in the colors list
Thickness 1. The LWIDTH= option2. The WIDTH= option in the ith generated SYMBOL defini-
tion, if LINKA=i is specified3. The default value, 1
Links Type 1. The LSTYLEB= optionfor 2. The LINE= option in the jth generated SYMBOLOptimal definition, if LINKB=j is specifiedDecision 3. The default value, 1 (solid line)
Color 1. The CBEST= option2. The CI= option in the jth generated SYMBOL definition,
if LINKB=j is specified3. GraphData2(‘ContrastColor’)4. The second color in the colors list
Thickness 1. The LWIDTHB= option2. The WIDTH= option in the jth generated SYMBOL defini-
tion, if LINKB=j is specified3. 2 times the thickness of links that represent regular out-
comesLinks Type 1. The LSTYLEC= optionThat 2. The LINE= option in the kth generated SYMBOLFall definition, if LINKC=k is specifiedacross 3. The default value, 2 (dot line)Pages Color 1. Depends on whether or not it represents an optimal decision
Thickness 1. Depends on whether or not it represents an optimal decision
Web-Enabled Decision TreeThe WEB= variable in the STAGEIN= data set enables you to define an HTML reference for each stage. ThisHTML reference is currently associated with all the decision tree nodes that correspond to the stage. TheWEB= variable is a character variable, and the values need to be of the form HREF=htmlpage.
In addition, you can also store the coordinate and link information defined by the WEB= option in a SAS dataset by specifying the IMAGEMAP= option in the PROC DTREE statement or in the TREEPLOT statement.If you process this SAS data set by using a DATA step, you can generate customized HTML pages for yourdecision tree diagram.
434 F Chapter 7: The DTREE Procedure
ODS Table NamesPROC DTREE assigns a name to each table that it creates. You can use these names to reference the tablewhen you use the Output Delivery System (ODS) to select tables and create output data sets. These namesare listed in Table 7.18. For more information about ODS, see the chapter on ODS in the SAS/STAT User’sGuide.
Table 7.18 ODS Tables Produced in PROC DTREE
ODS Table Name Description Statement / OptionParameters Decision parameters SUMMARY or EVALUATE /
SUMMARYPolicy Optimal decision policy SUMMARY or EVALUATE /
SUMMARYStages List of stages in order SUMMARY or EVALUATE /
SUMMARYTreeplot Line-printer plot of
decision treeTREEPLOT / LINEPRINTER
ODS Style TemplatesODS style templates, or styles, control the overall look of your output. An ODS style template consists ofa set of style elements. A style element is a collection of style attributes that apply to a particular featureor aspect of the output. You can specify a value for each attribute in a style. See Chapter 21, “StatisticalGraphics Using ODS” (SAS/STAT User’s Guide), for a thorough discussion of ODS Graphics.
To create your own style or to modify a style for use with ODS Graphics, you need to understand therelationships between style elements and graph features. This information is provided in the ODS Graphicsdocumentation at http://support.sas.com/documentation/onlinedoc/base/. You create andmodify style templates with the TEMPLATE procedure. For more information, see the section “TEMPLATEProcedure: Creating a Style Template” in the SAS Output Delivery System: User’s Guide. Kuhfeld (2010)also offers detailed information and examples.
PROC DTREE Style Template
A predefined ODS style template named DTREE is available for the DTREE procedure. You can use thetemplate to maintain a consistent appearance in all graphical output produced by the procedure.
To change the current style, specify the STYLE= option in an ODS destination statement. The specifiedstyle is applied to all output for that destination until you change or close the destination or start a new SASsession. For example, the following statement specifies that ODS should apply the DTREE style template toall HTML output:
ods html style=dtree;
To disable the use of graphical styles, specify the SAS system option NOGSTYLE.
ODS Style Templates F 435
The parent style template for the DTREE style is the DEFAULT style. Table 7.19 lists the style elements(in bold) and corresponding attributes specified in the DTREE style. The table also indicates which, if any,PROC DTREE options or graphics options (in a GOPTIONS statement) can be used to override the value ofa style attribute.
Table 7.19 Style Elements and Attributes in the DTREE StyleElement/Attributes Description DTREE Option GOPTIONGraphColors Colors of various graph featuresgcdata5 Decision nodes CSYMBOLD= COLORS=gcdata1 Chance nodes CSYMBOLC= COLORS=gcdata8 End nodes CSYMBOLE= COLORS=gcdata3 Regular links CLINK= COLORS=gcdata2 Optimal links CBEST= COLORS=gtextt Title text CTITLE=gtext Text CTEXT=GraphFonts Fonts for various graph featuresGraphDataFont Default FTEXT=GraphLabelFont Labels FTEXT=GraphTitleFont Title text FTITLE=GraphDataText Attributes related to general textContrastColor GraphColors(‘gtext’) CTEXT= CTEXT=Font GraphFonts(‘GraphDataFont’) FTEXT= FTEXT=GraphTitleText Attributes related to title textColor GraphColors(‘gtext’) CTITLE=Font GraphFonts(‘gtext’) FTITLE=GraphTitle1Text Attributes related to the first title textColor GraphColors(‘gtext’) CTITLE=Font GraphFonts(‘gtext’) FTITLE=GraphLabelText Attributes related to label textColor GraphColors(‘glabel’) CTEXT=Font GraphFonts(‘GraphTitleFont’) FTEXT=GraphDataDefault Default valuesColor GraphColors(‘gdata’) COLORS=GraphBackground Attributes related to graph backgroundImage Dtree.jpg CBACK=
Attributes that you do not override retain the values specified in the style template.
Figure 7.11 demonstrates features of the DTREE graphical style. The decision tree in the figure is the firstoutput from Example 7.4.
436 F Chapter 7: The DTREE Procedure
Figure 7.11 DTREE Style Template: Example
Default Values
If the SAS system option GSTYLE is in effect (this is the default), then the default values of certain PROCDTREE options can depend on the current ODS style template. See the section “Displaying the DecisionTree” on page 429 for more information.
Precision ErrorsWhen PROC DTREE detects an error, it displays a message on the SAS log to call it to your attention.If the error is in a statement other than the PROC DTREE statement and the QUIT statement, and if theERRHANDLE=QUIT option is not specified, the procedure ignores the erroneous statement and waits foryou to enter another statement. This gives you a chance to correct the mistake you made and keep running.You can exit the procedure at any time by specifying the QUIT statement.
If the error is in an input data set, typically, you will have to edit the data set and then reinvoke PROC DTREE.In one case, however, you can use an option to correct the problem. You may receive an error messageindicating that the sum of probabilities for a particular chance stage does not equal 1.0. If it is caused byroundoff errors in the summation, then you can reset the TOLERANCE= option to correct this error. For
Computer Resource Requirements F 437
example, suppose that your problem contains a chance stage that has three outcomes, 'Out1', 'Out2' and'Out3', and each has probability 1=3. Suppose also that you input their probabilities in the PROBIN= dataset as follows:
Out1 Out2 Out3 0.3333 0.3333 0.3333
Then, PROC DTREE detects the total probabilities for that stage as 0.9999, not equal to 1, and hence displaysan error message. The following RESET statement fixes the error:
reset tolerance=0.00015;
Alternatively, you can specify the AUTOSCALE option to ask the procedure to rescale the probabilitieswhenever this situation occurs.
Computer Resource RequirementsThere is no inherent limit on the size of the decision tree model that can be evaluated and analyzed with theDTREE procedure. The numbers of stages and outcomes are constrained only by the amount of memoryavailable. Naturally, there needs to be a sufficient amount of core memory available in order to invokeand initialize the SAS system. Furthermore, more memory is required to load the graphics sublibrary ifthe GRAPHICS option is specified. As far as possible, the procedure attempts to store all the data in corememory. However, if the problem is too large to fit in core memory, the procedure resorts to the use of utilitydata sets and swaps between core memory and utility data sets as necessary.
The storage requirement for the data area required by the procedure is proportional to the number of stagesand outcomes as well as the number of nodes2 in the decision tree model. The time required depends heavilyon the number of nodes in the decision tree.
Examples: DTREE ProcedureThis section contains six examples that illustrate several features and applications of the DTREE procedure.The aim of this section is to show you how to use PROC DTREE to solve your decision problem and gainvaluable insight into its structure.
Example 7.1 and Example 7.2 show two methods frequently used to spread the risk of a venture: buyinsurance and enter a partnership. Example 7.1 also illustrates the use of the VARIABLE statement toidentify the variables in the input data sets. Example 7.3 illustrates the use of the graphics options to producea graphics quality decision tree diagram. Example 7.4 illustrates the use of SYMBOL and GOPTIONSstatements and the Annotate facility to control the appearance of the decision tree diagram. Example 7.5demonstrates an application of PROC DTREE for financial decision problems. It also illustrates a situationwhere redundant data are necessary to determine the value of information. In addition, it shows a case wherethe results from the VPI and VPC statements are misleading if they are used without care. Example 7.6
2The number of nodes depends on the number of stages and the number of outcomes for each stage.
438 F Chapter 7: The DTREE Procedure
shows an application in litigation, a sophisticated use of sensitivity analysis. It also shows you how to dealwith the value of future money.
Finally, Table 7.27 and Table 7.28 list all the examples in this chapter, and the options and statements in theDTREE procedure that are illustrated by each example.
Example 7.1: Oil Wildcatter’s Problem with InsuranceAgain consider the oil wildcatter’s problem introduced in the section “Introductory Example” on page 385.Suppose that the wildcatter is concerned that the probability of a dry well may be as high as 0.5.
The wildcatter has learned that an insurance company is willing to offer him a policy that, with a premiumof $130,000, will redeem $200,000 if the well is dry. He would like to include the alternative of buyinginsurance into his analysis. One way to do this is to include a stage for this decision in the model. Thefollowing DATA step reads this new decision problem into the STAGEIN= data set named Dtoils4. Noticethe new stage named 'Insurance', which represents the decision of whether or not to buy the insurance.Also notice that the cost of the insurance is represented as a negative reward of $130,000.
/* -- create the STAGEIN= data set -- */data Dtoils4;format Stage $12. Stype $2. Outcome $14.
Succ $12. Premium dollar12.0;input Stage $12. Stype $4. Outcome $16. Succ $12.
Premium dollar12.0;datalines;Drill D Drill Insurance .. . Not_Drill . .Insurance D Buy_Insurance Cost -$130,000. . Do_Not_Buy Cost .Cost C Low Oil_Deposit .. . Fair Oil_Deposit .. . High Oil_Deposit .Oil_Deposit C Dry . .. . Wet . .. . Soaking . .;
Probabilities associated with the uncertain events are given in the PROBIN= data set named Dtoilp4. Exceptfor the order of the variables in this data set, it is the same as the Dtoilp1 data set given in the section“Introductory Example” on page 385.
/* -- create the PROBIN= data set -- */data Dtoilp4;input (V1-V3) ($) P1-P3 ;datalines;Low Fair High 0.2 0.6 0.2Dry Wet Soaking 0.5 0.3 0.2;
The payoffs for this problem are now calculated to include the cost and value of the insurance. The followingDATA step does this.
Example 7.1: Oil Wildcatter’s Problem with Insurance F 439
/* -- create PAYOFFS= data set -- */data Dtoilu4;input (Cost Deposit Drill Insuran) ($16.) ;format Drill $9. Insuran $14. Payoff dollar12.0;
/* determine the cost for this scenario */if Cost='Low' then Rcost=150000;else if Cost='Fair' then Rcost=300000;else Rcost=500000;
/* determine the oil deposit and the corresponding *//* net payoff for this scenario */if Deposit='Dry' then Return=0;else if Deposit='Wet' then Return=700000;else Return=1200000;
/* calculate the net return for this scenario */if Drill='Not_Drill' then Payoff=0;else Payoff=Return-Rcost;
/* determine redeem received for this scenario */if Insuran='Buy_Insurance' and Deposit='Dry' thenPayoff=Payoff+200000;
/* drop unneeded variables */drop Rcost Return;
datalines;Low Dry Not_Drill .Low Dry Drill Buy_InsuranceLow Dry Drill Do_Not_BuyLow Wet Not_Drill .Low Wet Drill Buy_InsuranceLow Wet Drill Do_Not_BuyLow Soaking Not_Drill .Low Soaking Drill Buy_InsuranceLow Soaking Drill Do_Not_BuyFair Dry Not_Drill .Fair Dry Drill Buy_InsuranceFair Dry Drill Do_Not_BuyFair Wet Not_Drill .Fair Wet Drill Buy_InsuranceFair Wet Drill Do_Not_BuyFair Soaking Not_Drill .Fair Soaking Drill Buy_InsuranceFair Soaking Drill Do_Not_BuyHigh Dry Not_Drill .High Dry Drill Buy_InsuranceHigh Dry Drill Do_Not_BuyHigh Wet Not_Drill .High Wet Drill Buy_InsuranceHigh Wet Drill Do_Not_BuyHigh Soaking Not_Drill .
440 F Chapter 7: The DTREE Procedure
High Soaking Drill Buy_InsuranceHigh Soaking Drill Do_Not_Buy;
The payoff table can be displayed with the following PROC PRINT statement:
/* -- print the payoff table -- */title "Oil Wildcatter's Problem";title3 "The Payoffs";
proc print data=Dtoilu4;run;
The table is shown in Output 7.1.1.
Output 7.1.1 Payoffs of the Oil Wildcatter’s Problem with an Insurance Option
Oil Wildcatter's Problem
The Payoffs
Oil Wildcatter's Problem
The Payoffs
Obs Cost Deposit Drill Insuran Payoff
1 Low Dry Not_Drill $0
2 Low Dry Drill Buy_Insurance $50,000
3 Low Dry Drill Do_Not_Buy $-150,000
4 Low Wet Not_Drill $0
5 Low Wet Drill Buy_Insurance $550,000
6 Low Wet Drill Do_Not_Buy $550,000
7 Low Soaking Not_Drill $0
8 Low Soaking Drill Buy_Insurance $1,050,000
9 Low Soaking Drill Do_Not_Buy $1,050,000
10 Fair Dry Not_Drill $0
11 Fair Dry Drill Buy_Insurance $-100,000
12 Fair Dry Drill Do_Not_Buy $-300,000
13 Fair Wet Not_Drill $0
14 Fair Wet Drill Buy_Insurance $400,000
15 Fair Wet Drill Do_Not_Buy $400,000
16 Fair Soaking Not_Drill $0
17 Fair Soaking Drill Buy_Insurance $900,000
18 Fair Soaking Drill Do_Not_Buy $900,000
19 High Dry Not_Drill $0
20 High Dry Drill Buy_Insurance $-300,000
21 High Dry Drill Do_Not_Buy $-500,000
22 High Wet Not_Drill $0
23 High Wet Drill Buy_Insurance $200,000
24 High Wet Drill Do_Not_Buy $200,000
25 High Soaking Not_Drill $0
26 High Soaking Drill Buy_Insurance $700,000
27 High Soaking Drill Do_Not_Buy $700,000
To find the optimal decision, call PROC DTREE with the following statements:
Example 7.1: Oil Wildcatter’s Problem with Insurance F 441
/* -- PROC DTREE statements -- */title "Oil Wildcatter's Problem";
proc dtree stagein=Dtoils4probin=Dtoilp4payoffs=Dtoilu4nowarning;
variables / stage=Stage type=Stype outcome=(Outcome)reward=(Premium) successor=(Succ)event=(V1 V2 V3) prob=(P1 P2 P3)state=(Cost Deposit Drill Insuran)payoff=(Payoff);
evaluate;summary / target=Insurance;
The VARIABLES statement identifies the variables in the input data sets. The yield of the optimal decision iswritten to the SAS log as:
NOTE: Present order of stages:
Drill(D), Insurance(D), Cost(C), Oil_Deposit(C),_ENDST_(E).
NOTE: The currently optimal decision yields 140000.
The optimal decision summary produced by the SUMMARY statements are shown in Output 7.1.2. Thesummary in Output 7.1.2 shows that the insurance policy is worth $240,000 - $140,000 = $100,000, but sinceit costs $130,000, the wildcatter should reject such an insurance policy.
Output 7.1.2 Summary of the Oil Wildcatter’s Problem
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Drill Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
442 F Chapter 7: The DTREE Procedure
Output 7.1.2 continued
Optimal Decision Policy
Up to Stage Insurance
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Drill Buy_Insurance $-130,000 $240,000
Drill Do_Not_Buy $0 $140,000*
Now assume that the oil wildcatter is risk averse and has an exponential utility function with a risk toleranceof $1,200,000. In order to evaluate his problem based on this decision criterion, the wildcatter reevaluates theproblem with the following statements:
reset criterion=maxce rt=1200000;summary / target=Insurance;
The output from PROC DTREE given in Output 7.1.3 shows that the decision to purchase an insurance policyis favorable in the risk-averse environment. Note that an EVALUATE statement is not necessary before theSUMMARY statement. PROC DTREE evaluates the decision tree automatically when the decision criterionhas been changed using the RESET statement.
Output 7.1.3 Summary of the Oil Wildcatter’s Problem with RT = 1,200,000
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Drill Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $45,728
Optimal Decision Policy
Up to Stage Insurance
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Drill Buy_Insurance $-130,000 $175,728*
Drill Do_Not_Buy $0 $44,499
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 443
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse SettingContinuing with the oil wildcatter’s problem, suppose that in addition to possibly buying insurance to spreadthe risk of the venture, the wildcatter is considering sharing the risk by selling a portion of this venture toother investors. Now, the decision he faces is whether to buy insurance or not and what percentage of theinvestment to divest. Again, assume that the wildcatter is risk averse with a risk tolerance of $1,200,000.Notice that in the program that follows the 'Divestment' decision includes possibilities of no divestment to100% divestment in 10% increments.
/* -- create the STAGEIN= data set -- */data Dtoils4;format _STNAME_ $12. _OUTCOM_ $15. _SUCCES_ $12.;input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $
_SUCCES_ $ ;datalines;Divestment Decision No_Divestment Insurance. . 10%_Divestment Insurance. . 20%_Divestment Insurance. . 30%_Divestment Insurance. . 40%_Divestment Insurance. . 50%_Divestment Insurance. . 60%_Divestment Insurance. . 70%_Divestment Insurance. . 80%_Divestment Insurance. . 90%_Divestment Insurance. . 100%_Divestment .Insurance Decision Buy_Insurance Cost. . Do_Not_Buy CostCost Chance Low Oil_Deposit. . Fair Oil_Deposit. . High Oil_DepositOil_Deposit Chance Dry .. . Wet .. . Soaking .;
The probabilities associated with the uncertain events are given in the PROBIN= data set named Dtoilp4.Except for the order of the variables in this data set, it is the same as the Dtoilp1 data set used in the section“Introductory Example” on page 385.
/* -- create the PROBIN= data set -- */data Dtoilp4;input _EVENT1 $ _PROB1 _EVENT3 $ _PROB3 ;datalines;Low 0.2 Dry 0.5Fair 0.6 Wet 0.3High 0.2 Soaking 0.2;
/* -- create the PAYOFFS= data set -- */data Dtoilu4(drop=i j k l);length _STATE1-_STATE4 $16. ;
444 F Chapter 7: The DTREE Procedure
format _VALUE_ dollar12.0;
/* define and initialize arrays */array DIVEST{11} $16. _TEMPORARY_ ('No_Divestment',
'10%_Divestment','20%_Divestment','30%_Divestment','40%_Divestment','50%_Divestment','60%_Divestment','70%_Divestment','80%_Divestment','90%_Divestment','100%_Divestment' );
array INSUR{3} $16. _TEMPORARY_ ('Do_Not_Buy','Buy_Insurance',' ' );
array COST{4} $ _TEMPORARY_ ('Low','Fair','High',' ' );
array DEPOSIT{4} $ _TEMPORARY_ ('Dry','Wet','Soaking',' ' );
do i=1 to 10; /* loop for each divestment */_STATE1=DIVEST{i};
/** determine the percentage of ownership retained
* for this scenario
*/PCT=1.0-((i-1)*0.1);
do j=1 to 2; /* loop for insurance decision */_STATE2=INSUR{j};
/** determine the premium need to pay for this
* scenario
*/if _STATE2='Buy_Insurance' then PREMIUM=130000;else PREMIUM=0;
do k=1 to 3; /* loop for each well cost */_STATE3=COST{k};
/* determine the cost for this scenario */if _STATE3='Low' then _COST_=150000;else if _STATE3='Fair' then _COST_=300000;else _COST_=500000;
do l=1 to 3; /* loop for each deposit type */
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 445
_STATE4=DEPOSIT{l};
/** determine the oil deposit and the
* corresponding net payoff for this scenario
*/if _STATE4='Dry' then _PAYOFF_=0;else if _STATE4='Wet' then _PAYOFF_=700000;else _PAYOFF_=1200000;
/* determine redeem received for this scenario */if _STATE2='Buy_Insurance' and _STATE4='Dry' then
REDEEM=200000;else REDEEM=0;
/* calculate the net return for this scenario */_VALUE_=(_PAYOFF_-_COST_-PREMIUM+REDEEM)*PCT;
/* drop unneeded variables */drop _COST_ _PAYOFF_ PREMIUM REDEEM PCT;
/* output this record */output;
end;end;
end;end;
/* output an observation for the scenario 100%_Divestment */_STATE1=DIVEST{11};_STATE2=INSUR{3};_STATE3=COST{4};_STATE4=DEPOSIT{4};_VALUE_=0;output;
run;
The Dtoilu4 data set for this problem, which contains 181 observations and 5 variables, is displayed inOutput 7.2.1.
446 F Chapter 7: The DTREE Procedure
Output 7.2.1 Payoffs of the Oil Wildcatter’s Problem with Risk Sharing
Oil Wildcatter's Problem
The Payoffs
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
1 No_Divestment Do_Not_Buy Low Dry $-150,000
2 No_Divestment Do_Not_Buy Low Wet $550,000
3 No_Divestment Do_Not_Buy Low Soaking $1,050,000
4 No_Divestment Do_Not_Buy Fair Dry $-300,000
5 No_Divestment Do_Not_Buy Fair Wet $400,000
6 No_Divestment Do_Not_Buy Fair Soaking $900,000
7 No_Divestment Do_Not_Buy High Dry $-500,000
8 No_Divestment Do_Not_Buy High Wet $200,000
9 No_Divestment Do_Not_Buy High Soaking $700,000
10 No_Divestment Buy_Insurance Low Dry $-80,000
11 No_Divestment Buy_Insurance Low Wet $420,000
12 No_Divestment Buy_Insurance Low Soaking $920,000
13 No_Divestment Buy_Insurance Fair Dry $-230,000
14 No_Divestment Buy_Insurance Fair Wet $270,000
15 No_Divestment Buy_Insurance Fair Soaking $770,000
16 No_Divestment Buy_Insurance High Dry $-430,000
17 No_Divestment Buy_Insurance High Wet $70,000
18 No_Divestment Buy_Insurance High Soaking $570,000
19 10%_Divestment Do_Not_Buy Low Dry $-135,000
20 10%_Divestment Do_Not_Buy Low Wet $495,000
21 10%_Divestment Do_Not_Buy Low Soaking $945,000
22 10%_Divestment Do_Not_Buy Fair Dry $-270,000
23 10%_Divestment Do_Not_Buy Fair Wet $360,000
24 10%_Divestment Do_Not_Buy Fair Soaking $810,000
25 10%_Divestment Do_Not_Buy High Dry $-450,000
26 10%_Divestment Do_Not_Buy High Wet $180,000
27 10%_Divestment Do_Not_Buy High Soaking $630,000
28 10%_Divestment Buy_Insurance Low Dry $-72,000
29 10%_Divestment Buy_Insurance Low Wet $378,000
30 10%_Divestment Buy_Insurance Low Soaking $828,000
31 10%_Divestment Buy_Insurance Fair Dry $-207,000
32 10%_Divestment Buy_Insurance Fair Wet $243,000
33 10%_Divestment Buy_Insurance Fair Soaking $693,000
34 10%_Divestment Buy_Insurance High Dry $-387,000
35 10%_Divestment Buy_Insurance High Wet $63,000
36 10%_Divestment Buy_Insurance High Soaking $513,000
37 20%_Divestment Do_Not_Buy Low Dry $-120,000
38 20%_Divestment Do_Not_Buy Low Wet $440,000
39 20%_Divestment Do_Not_Buy Low Soaking $840,000
40 20%_Divestment Do_Not_Buy Fair Dry $-240,000
41 20%_Divestment Do_Not_Buy Fair Wet $320,000
42 20%_Divestment Do_Not_Buy Fair Soaking $720,000
43 20%_Divestment Do_Not_Buy High Dry $-400,000
44 20%_Divestment Do_Not_Buy High Wet $160,000
45 20%_Divestment Do_Not_Buy High Soaking $560,000
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 447
Output 7.2.1 continued
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
46 20%_Divestment Buy_Insurance Low Dry $-64,000
47 20%_Divestment Buy_Insurance Low Wet $336,000
48 20%_Divestment Buy_Insurance Low Soaking $736,000
49 20%_Divestment Buy_Insurance Fair Dry $-184,000
50 20%_Divestment Buy_Insurance Fair Wet $216,000
51 20%_Divestment Buy_Insurance Fair Soaking $616,000
52 20%_Divestment Buy_Insurance High Dry $-344,000
53 20%_Divestment Buy_Insurance High Wet $56,000
54 20%_Divestment Buy_Insurance High Soaking $456,000
55 30%_Divestment Do_Not_Buy Low Dry $-105,000
56 30%_Divestment Do_Not_Buy Low Wet $385,000
57 30%_Divestment Do_Not_Buy Low Soaking $735,000
58 30%_Divestment Do_Not_Buy Fair Dry $-210,000
59 30%_Divestment Do_Not_Buy Fair Wet $280,000
60 30%_Divestment Do_Not_Buy Fair Soaking $630,000
61 30%_Divestment Do_Not_Buy High Dry $-350,000
62 30%_Divestment Do_Not_Buy High Wet $140,000
63 30%_Divestment Do_Not_Buy High Soaking $490,000
64 30%_Divestment Buy_Insurance Low Dry $-56,000
65 30%_Divestment Buy_Insurance Low Wet $294,000
66 30%_Divestment Buy_Insurance Low Soaking $644,000
67 30%_Divestment Buy_Insurance Fair Dry $-161,000
68 30%_Divestment Buy_Insurance Fair Wet $189,000
69 30%_Divestment Buy_Insurance Fair Soaking $539,000
70 30%_Divestment Buy_Insurance High Dry $-301,000
71 30%_Divestment Buy_Insurance High Wet $49,000
72 30%_Divestment Buy_Insurance High Soaking $399,000
73 40%_Divestment Do_Not_Buy Low Dry $-90,000
74 40%_Divestment Do_Not_Buy Low Wet $330,000
75 40%_Divestment Do_Not_Buy Low Soaking $630,000
76 40%_Divestment Do_Not_Buy Fair Dry $-180,000
77 40%_Divestment Do_Not_Buy Fair Wet $240,000
78 40%_Divestment Do_Not_Buy Fair Soaking $540,000
79 40%_Divestment Do_Not_Buy High Dry $-300,000
80 40%_Divestment Do_Not_Buy High Wet $120,000
81 40%_Divestment Do_Not_Buy High Soaking $420,000
82 40%_Divestment Buy_Insurance Low Dry $-48,000
83 40%_Divestment Buy_Insurance Low Wet $252,000
84 40%_Divestment Buy_Insurance Low Soaking $552,000
85 40%_Divestment Buy_Insurance Fair Dry $-138,000
86 40%_Divestment Buy_Insurance Fair Wet $162,000
87 40%_Divestment Buy_Insurance Fair Soaking $462,000
88 40%_Divestment Buy_Insurance High Dry $-258,000
89 40%_Divestment Buy_Insurance High Wet $42,000
90 40%_Divestment Buy_Insurance High Soaking $342,000
448 F Chapter 7: The DTREE Procedure
Output 7.2.1 continued
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
91 50%_Divestment Do_Not_Buy Low Dry $-75,000
92 50%_Divestment Do_Not_Buy Low Wet $275,000
93 50%_Divestment Do_Not_Buy Low Soaking $525,000
94 50%_Divestment Do_Not_Buy Fair Dry $-150,000
95 50%_Divestment Do_Not_Buy Fair Wet $200,000
96 50%_Divestment Do_Not_Buy Fair Soaking $450,000
97 50%_Divestment Do_Not_Buy High Dry $-250,000
98 50%_Divestment Do_Not_Buy High Wet $100,000
99 50%_Divestment Do_Not_Buy High Soaking $350,000
100 50%_Divestment Buy_Insurance Low Dry $-40,000
101 50%_Divestment Buy_Insurance Low Wet $210,000
102 50%_Divestment Buy_Insurance Low Soaking $460,000
103 50%_Divestment Buy_Insurance Fair Dry $-115,000
104 50%_Divestment Buy_Insurance Fair Wet $135,000
105 50%_Divestment Buy_Insurance Fair Soaking $385,000
106 50%_Divestment Buy_Insurance High Dry $-215,000
107 50%_Divestment Buy_Insurance High Wet $35,000
108 50%_Divestment Buy_Insurance High Soaking $285,000
109 60%_Divestment Do_Not_Buy Low Dry $-60,000
110 60%_Divestment Do_Not_Buy Low Wet $220,000
111 60%_Divestment Do_Not_Buy Low Soaking $420,000
112 60%_Divestment Do_Not_Buy Fair Dry $-120,000
113 60%_Divestment Do_Not_Buy Fair Wet $160,000
114 60%_Divestment Do_Not_Buy Fair Soaking $360,000
115 60%_Divestment Do_Not_Buy High Dry $-200,000
116 60%_Divestment Do_Not_Buy High Wet $80,000
117 60%_Divestment Do_Not_Buy High Soaking $280,000
118 60%_Divestment Buy_Insurance Low Dry $-32,000
119 60%_Divestment Buy_Insurance Low Wet $168,000
120 60%_Divestment Buy_Insurance Low Soaking $368,000
121 60%_Divestment Buy_Insurance Fair Dry $-92,000
122 60%_Divestment Buy_Insurance Fair Wet $108,000
123 60%_Divestment Buy_Insurance Fair Soaking $308,000
124 60%_Divestment Buy_Insurance High Dry $-172,000
125 60%_Divestment Buy_Insurance High Wet $28,000
126 60%_Divestment Buy_Insurance High Soaking $228,000
127 70%_Divestment Do_Not_Buy Low Dry $-45,000
128 70%_Divestment Do_Not_Buy Low Wet $165,000
129 70%_Divestment Do_Not_Buy Low Soaking $315,000
130 70%_Divestment Do_Not_Buy Fair Dry $-90,000
131 70%_Divestment Do_Not_Buy Fair Wet $120,000
132 70%_Divestment Do_Not_Buy Fair Soaking $270,000
133 70%_Divestment Do_Not_Buy High Dry $-150,000
134 70%_Divestment Do_Not_Buy High Wet $60,000
135 70%_Divestment Do_Not_Buy High Soaking $210,000
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 449
Output 7.2.1 continued
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
136 70%_Divestment Buy_Insurance Low Dry $-24,000
137 70%_Divestment Buy_Insurance Low Wet $126,000
138 70%_Divestment Buy_Insurance Low Soaking $276,000
139 70%_Divestment Buy_Insurance Fair Dry $-69,000
140 70%_Divestment Buy_Insurance Fair Wet $81,000
141 70%_Divestment Buy_Insurance Fair Soaking $231,000
142 70%_Divestment Buy_Insurance High Dry $-129,000
143 70%_Divestment Buy_Insurance High Wet $21,000
144 70%_Divestment Buy_Insurance High Soaking $171,000
145 80%_Divestment Do_Not_Buy Low Dry $-30,000
146 80%_Divestment Do_Not_Buy Low Wet $110,000
147 80%_Divestment Do_Not_Buy Low Soaking $210,000
148 80%_Divestment Do_Not_Buy Fair Dry $-60,000
149 80%_Divestment Do_Not_Buy Fair Wet $80,000
150 80%_Divestment Do_Not_Buy Fair Soaking $180,000
151 80%_Divestment Do_Not_Buy High Dry $-100,000
152 80%_Divestment Do_Not_Buy High Wet $40,000
153 80%_Divestment Do_Not_Buy High Soaking $140,000
154 80%_Divestment Buy_Insurance Low Dry $-16,000
155 80%_Divestment Buy_Insurance Low Wet $84,000
156 80%_Divestment Buy_Insurance Low Soaking $184,000
157 80%_Divestment Buy_Insurance Fair Dry $-46,000
158 80%_Divestment Buy_Insurance Fair Wet $54,000
159 80%_Divestment Buy_Insurance Fair Soaking $154,000
160 80%_Divestment Buy_Insurance High Dry $-86,000
161 80%_Divestment Buy_Insurance High Wet $14,000
162 80%_Divestment Buy_Insurance High Soaking $114,000
163 90%_Divestment Do_Not_Buy Low Dry $-15,000
164 90%_Divestment Do_Not_Buy Low Wet $55,000
165 90%_Divestment Do_Not_Buy Low Soaking $105,000
166 90%_Divestment Do_Not_Buy Fair Dry $-30,000
167 90%_Divestment Do_Not_Buy Fair Wet $40,000
168 90%_Divestment Do_Not_Buy Fair Soaking $90,000
169 90%_Divestment Do_Not_Buy High Dry $-50,000
170 90%_Divestment Do_Not_Buy High Wet $20,000
171 90%_Divestment Do_Not_Buy High Soaking $70,000
172 90%_Divestment Buy_Insurance Low Dry $-8,000
173 90%_Divestment Buy_Insurance Low Wet $42,000
174 90%_Divestment Buy_Insurance Low Soaking $92,000
175 90%_Divestment Buy_Insurance Fair Dry $-23,000
176 90%_Divestment Buy_Insurance Fair Wet $27,000
177 90%_Divestment Buy_Insurance Fair Soaking $77,000
178 90%_Divestment Buy_Insurance High Dry $-43,000
179 90%_Divestment Buy_Insurance High Wet $7,000
450 F Chapter 7: The DTREE Procedure
Output 7.2.1 continued
Oil Wildcatter's Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
180 90%_Divestment Buy_Insurance High Soaking $57,000
181 100%_Divestment $0
The optimal decisions for this problem can be identified by invoking PROC DTREE and using the SUMMARYstatement as follows:
title "Oil Wildcatter's Problem";proc dtree stagein=Dtoils4
probin=Dtoilp4payoffs=Dtoilu4criterion=maxce rt=1200000nowarning;
evaluate;summary / target=Divestment;summary / target=Insurance;
quit;
The optimal decision summaries in Output 7.2.2 and Output 7.2.3 show the optimal strategy for the wildcatter.
� The wildcatter should sell 30% of his investment to other companies and reject the insurance policyoffered to him.
� The insurance policy should be accepted only if the decision to not divest is made.
� If the decision to buy the insurance policy is made, then it is optimal to divest 10% of the venture.
Output 7.2.2 Summary of the Oil Wildcatter’s Problem for DIVESTMENT
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Divestment Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $50,104
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 451
Output 7.2.2 continued
Optimal Decision Policy
Up to Stage Divestment
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
No_Divestment $45,728
10%_Divestment $48,021
20%_Divestment $49,907
30%_Divestment $50,104*
40%_Divestment $48,558
50%_Divestment $45,219
60%_Divestment $40,036
70%_Divestment $32,965
80%_Divestment $23,961
90%_Divestment $12,985
100%_Divestment $0
Output 7.2.3 Summary of the Oil Wildcatter’s Problem for INSURANCE
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Oil Wildcatter's Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Divestment Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $50,104
452 F Chapter 7: The DTREE Procedure
Output 7.2.3 continued
Optimal Decision Policy
Up to Stage Insurance
Alternatives or OutcomesCumulative
RewardEvaluating
Value
No_Divestment Buy_Insurance $45,728*
No_Divestment Do_Not_Buy $44,499
10%_Divestment Buy_Insurance $46,552
10%_Divestment Do_Not_Buy $48,021*
20%_Divestment Buy_Insurance $46,257
20%_Divestment Do_Not_Buy $49,907*
30%_Divestment Buy_Insurance $44,812
30%_Divestment Do_Not_Buy $50,104*
40%_Divestment Buy_Insurance $42,186
40%_Divestment Do_Not_Buy $48,558*
50%_Divestment Buy_Insurance $38,350
50%_Divestment Do_Not_Buy $45,219*
60%_Divestment Buy_Insurance $33,273
60%_Divestment Do_Not_Buy $40,036*
70%_Divestment Buy_Insurance $26,927
70%_Divestment Do_Not_Buy $32,965*
80%_Divestment Buy_Insurance $19,284
80%_Divestment Do_Not_Buy $23,961*
90%_Divestment Buy_Insurance $10,317
90%_Divestment Do_Not_Buy $12,985*
This information can be illustrated graphically using the GPLOT procedure. Output 7.2.4, produced bythe PROC GPLOT statements shown in the following code, provides a clear picture of the effects of thedivestment possibilities and the insurance options.
/* create a data set for the return corresponds to each *//* divestment possibilities and the insurance options */
data Data2g;input INSURE DIVEST VALUE;datalines;
1 0 457280 0 444991 10 465520 10 480211 20 462570 20 499071 30 448120 30 501041 40 421860 40 485581 50 383500 50 452191 60 332730 60 400361 70 269270 70 32965
Example 7.2: Oil Wildcatter’s Problem in Risk-Averse Setting F 453
1 80 192840 80 239611 90 103170 90 129851 100 00 100 0
;
/* -- define a format for INSURE variable -- */proc format;
value sample 0='Do_Not_Buy' 1='Buy_Insurance';run;
/* -- define title -- */title h=3 "Oil Wildcatter's Problem";
/* define legend -- */legend1 frame cframe=white label=none
cborder=black position=center ;
/* define symbol characteristics of the data points *//* and the interpolation line for returns vs divestment *//* when INSURE=0 */
symbol1 c=cyan i=join v=dot l=1 h=1;
/* define symbol characteristics of the data points *//* and the interpolation line for returns vs divestment *//* when INSURE=1 */
symbol2 c=green i=join v=square l=2 h=1;
/* -- define axis characteristics -- */axis1 minor=none label=('Divestment (in percentage)');axis2 minor=none label=(angle=90 rotate=0 'Certainty Equivalent');
/* set graphics options */goptions htext=1.5;
/* plot VALUE vs DIVEST using INSURE as third variable */proc gplot data=Data2g ;
plot VALUE*DIVEST=INSURE / haxis=axis1vaxis=axis2legend=legend1name="dt2"framecframe=white ;
format INSURE SAMPLE.;run;
quit;
Note that the data input into the Data2g data set is obtained from the optimal decision summary as inOutput 7.2.3. The value 1 of the INSURE variable represents the alternative 'Buy_Insurance' and thevalue 0 represents the alternative 'Do_Not_Buy'.
454 F Chapter 7: The DTREE Procedure
Output 7.2.4 Returns of the Oil Wildcatter’s Problem
Example 7.3: Contract Bidding ProblemThis example illustrates the use of several of the graphics options for producing graphics quality decisiontree diagrams.
The production manager of a manufacturing company is planning to bid on a project to manufacture a newtype of machine. He has the choice of bidding low or high. The evaluation of the bid will more likelybe favorable if the bidder has built a prototype of the machine and includes it with the bid. However, heis uncertain about the cost of building the prototype.- His technical staff has provided him a probabilitydistribution on the cost of the prototype.
Table 7.20 Probability on the Cost of Building Prototype
Outcome Cost ProbabilityExpensive $4,500 0.4Moderate $2,500 0.5Inexpensive $1,000 0.1
There is also uncertainty in whether he will win the contract or not. He has estimated the probabilitydistribution of winning the contract as shown in Table 7.21.
Example 7.3: Contract Bidding Problem F 455
Table 7.21 Probability of Winning the Contract
EventsGivens Win the Contract Lose the ContractBuild Prototype High Bid 0.4 0.6Build Prototype Low Bid 0.8 0.2No Prototype High Bid 0.2 0.8No Prototype Low Bid 0.7 0.3
In addition, the payoffs of this bidding venture are affected by the cost of building the prototype. Table 7.22shows his payoffs. The first row of the table shows the payoff is 0 if he loses the contract, regardless ofwhether or not he builds the prototype and whether he bids low or high. The remainder of the entries in thetable give the payoff under the various scenarios.
Table 7.22 Payoffs of the Contract Bidding Decision
States ActionsResult Cost Bid low Bid highLose the Contract 0 0Win the Contract $35,000 $75,000Win the Contract Expensive $25,000 $65,000Win the Contract Moderate $35,000 $75,000Win the Contract Inexpensive $45,000 $85,000
The production manager must decide whether to build the prototype and how to bid. He uses PROCDTREE to help him to make these decisions. The structure of the model is stored in the STAGEIN=data set named Stage3. There are two decision stages, 'Choose' and 'Bid', and two chance stages,'Cost_Prototype' and 'Contract'. The 'Choose' stage represents the decision whether or not to builda prototype. The chance stage 'Cost_Prototype' represents the uncertain cost for building a prototype. Itcan be 'Expensive', which costs $4,500, or 'Moderate', which costs $2,500, or 'Inexpensive', whichcosts $1,000. The 'Bid' stage represents the decision whether to bid high or bid low. The last stage,'Contract', represents the result, either win the contract or lose the contract.
/* -- create the STAGEIN= data set -- */data Stage3;format _STNAME_ $14. _STTYPE_ $2. _OUTCOM_ $15.
_SUCCES_ $14. _REWARD_ dollar8.0 ;input _STNAME_ $16. _STTYPE_ $4. _OUTCOM_ $16.
_SUCCES_ $16. _REWARD_ dollar8.0 ;datalines;Choose D Build_Prototype Cost_Prototype .. . No_Prototype Bid .Cost_Prototype C Expensive Bid -$4,500. . Moderate Bid -$2,500. . Inexpensive Bid -$1,000Bid D High_Bid Contract .. . Low_Bid Contract .Contract C Win_Contract . .. . Lose_Contract . .;
456 F Chapter 7: The DTREE Procedure
The PROBIN= data set, named Prob3, contains the probability information as in Table 7.20 and Table 7.21.
/* -- create the PROBIN= data set -- */data Prob3;format _GIVEN1_ $15. _GIVEN2_ $15. _EVENT_ $14. ;input (_GIVEN1_ _GIVEN2_ _EVENT_) ($) _PROB_;datalines;. . Expensive 0.4. . Moderate 0.5. . Inexpensive 0.1Build_Prototype High_Bid Win_Contract 0.4Build_Prototype High_Bid Lose_Contract 0.6Build_Prototype Low_Bid Win_Contract 0.8Build_Prototype Low_Bid Lose_Contract 0.2No_Prototype High_Bid Win_Contract 0.2No_Prototype High_Bid Lose_Contract 0.8No_Prototype Low_Bid Win_Contract 0.7No_Prototype Low_Bid Lose_Contract 0.3;
The PAYOFFS= data set named Payoff3 contains the payoff information as in Table 7.22. Notice that thepayoff to outcome 'Lose_Contract' is not in the data set Payoff3. Since PROC DTREE assigns the defaultvalue 0 to all scenarios that are not in the PAYOFFS= data set, it is not necessary to include it.
/* -- create the PAYOFFS= data set -- */data Payoff3;format _STATE1_ _STATE2_ $12.;input (_STATE1_ _STATE2_ _ACTION_) ($16.)
_VALUE_ dollar8.0;datalines;Win_Contract . Low_Bid $35,000Win_Contract . High_Bid $75,000Win_Contract Expensive Low_Bid $25,000Win_Contract Expensive High_Bid $65,000Win_Contract Moderate Low_Bid $35,000Win_Contract Moderate High_Bid $75,000Win_Contract Inexpensive Low_Bid $45,000Win_Contract Inexpensive High_Bid $85,000;
Example 7.3: Contract Bidding Problem F 457
The solution, as in Output 7.3.1, is displayed on a graphics device with the following code. Notice that thetitle is specified before invoking PROC DTREE. The GRAPHICS option is given on the PROC DTREEstatement. Specifying the COMPRESS option in the TREEPLOT statement causes the decision tree diagramto be drawn completely on one page. The vertical distance between two successive end nodes is 1 charactercell (ybetween=1 cell). All text, except that in the first title line, is drawn with the font specified by theFTEXT= option.The height for all nodes is the number of character cells specified by the HSYMBOL=option. The thickness for all links in the diagram, except those that represent optimal decisions, is specifiedby the LWIDTH= option. The thickness of the links that represent optimal decisions is specified by theLWIDTHB= option, and the type of those links is 3 (lstyleb=3), the dash line. Colors for the text, linksand nodes, and symbols to be used for nodes are not specified and hence defaults are used.
goptions ctext=black;goptions hsize=10in htext=3.0;/* -- define title -- */
title1 h=2 "Contract Bidding Example" ;
/* -- PROC DTREE statements -- */proc dtree stagein=Stage3 probin=Prob3 payoffs=Payoff3
graphicsnowarning;
evaluate;treeplot / name="dt3" compress ybetween=1 cell
hsymbol=6lstyleb=3 lwidth=1 lwidthb=1;
quit;
458 F Chapter 7: The DTREE Procedure
Output 7.3.1 Decision Tree for the Contract Bidding Problem
Example 7.4: Research and Development Decision Problem F 459
With the information on this decision tree, the production manager can select the optimal bidding strategy:
� He should build a prototype to accompany the bid and always bid high unless the cost for building theprototype is as low as $1,000. This optimal strategy yields an expected return of $25,850.
� If no prototype is built, the preferred decision is to make a low bid. In this case the expected return is$24,500.
Example 7.4: Research and Development Decision ProblemThis example illustrates the use of the SYMBOL and GOPTIONS statements for controlling the appearanceof the decision tree diagram. It also uses the ANNOTATE= option to add a customized legend to the diagram.
A typical problem encountered in a research and development setting involves two decisions: whether or notto conduct research, and whether or not to commercialize the results of that research. Suppose that researchand development for a specific project will cost $350,000, and there is a 0.4 probability that it will fail. Alsosuppose that the different levels of market success and their corresponding probabilities are:
Table 7.23 Levels of Market Success and Their Probabilities
Market Success Net Return ProbabilityGreat $1,000,000 0.25Good $500,000 0.35Fair $200,000 0.30Poor -$250,000 0.10
The structure of the model is represented in the STAGEIN= data set Stage4.
/* -- create the STAGEIN= data set -- */data Stage4;input _STNAME_ $ 1-16 _STTYPE_ $ 17-20_OUTCOM_ $ 21-32 _REWARD_ dollar12.0_SUCC_ $ 45-60;
datalines;R_and_D D Not_Conduct . .. . Conduct -$350,000 RD_OutcomeRD_Outcome C Success . Production. . Failure . .Production D Produce . Sales. . Abandon . .Sales C Great . .. . Good . .. . Fair . .. . Poor . .;
The probability distributions for the various outcomes of the chance stages are given in the PROBIN= dataset named Prob4.
460 F Chapter 7: The DTREE Procedure
/* -- create the PROBIN= data set -- */data Prob4;input _EVENT1_ $ _PROB1_ _EVENT2_ $12. _PROB2_;datalines;Success 0.6 Failure 0.4Great 0.25 Good 0.35Fair 0.30 poor 0.1;
The payoffs are given in the PAYOFFS= data set Payoff4.
/* -- create the PAYOFFS= data set -- */data Payoff4;input _STATE_ $12. _VALUE_ dollar12.0;datalines;Great $1,000,000Good $500,000Fair $200,000Poor -$250,000;
The following DATA step builds a data set that contains the Annotate description of a legend. Refer to thechapter on the annotate facility in SAS/GRAPH Software: Reference for a description of the Annotate facility.
/* -- create the ANNOTATE= data set for legend -- */data Legend;length FUNCTION $ 8;length STYLE $ 16;WHEN = 'B'; POSITION='0';XSYS='4'; YSYS='4';input FUNCTION $ X Y STYLE & 16. SIZE COLOR $ TEXT $ & 16.;datalines;move 8 2.1 . . . .draw 12 2.1 . 8 red .label 14 2 Cumberland AMT 0.6 black BEST ACTIONsymbol 9 3.5 marker 0.6 red Alabel 14 3.2 Cumberland AMT 0.6 black END NODEsymbol 9 4.7 marker 0.6 blue Plabel 14 4.4 Cumberland AMT 0.6 black CHANCE NODEsymbol 9 5.9 marker 0.6 green Ulabel 14 5.6 Cumberland AMT 0.6 black DECISION NODElabel 8 7.0 Cumberland AMT 0.6 black LEGEND:move 5 8.5 . . black .draw 35 8.5 . 2 black .draw 35 1 . 2 black .draw 5 1 . 2 black .draw 5 8.5 . 2 black .;
Example 7.4: Research and Development Decision Problem F 461
The following program invokes PROC DTREE, which evaluates the decision tree and plots it on a graphicsdevice using the Annotate data set Legend to draw the legend.
/* define symbol characteristics for chance nodes and *//* links except those that represent optimal decisions */
symbol1 f=marker h=1.8 v=P c=blue w=5 l=1;
/* define symbol characteristics for decision nodes *//* and links that represent optimal decisions */
symbol2 f=marker h=1.8 v=U cv=green ci=red w=10 l=1;
/* define symbol characteristics for end nodes */symbol3 f=marker h=1.8 v=A cv=red;
/* define graphics options */goptions htext=1.2;
/* -- define title -- */title f='Cumberland AMT'h=2.5 'Research and Development Decision';
/* -- PROC DTREE statements -- */proc dtree
stagein=Stage4 probin=Prob4 payoffs=Payoff4criterion=maxce rt=1800000graphics annotate=Legend nolg ;
evaluate;
treeplot / linka=1 linkb=2symbold=2 symbolc=1 symbole=3 compress name="dt4";
quit;
The SYMBOL1, SYMBOL2, and SYMBOL3 statements create three SYMBOL definitions that containinformation for drawing nodes and links. The Legend data set and the ANNOTATE= option specified in thePROC DTREE statement cause the procedure to produce a customized legend for the decision tree diagram.The LINKA=, LINKB=, SYMBOLD=, SYMBOLC=, and SYMBOLE= specifications in the TREEPLOTstatement tell PROC DTREE how to use SYMBOL definitions to draw the decision tree. Table 7.24 describesthe options in SYMBOL definitions used to draw the decision tree diagram.
462 F Chapter 7: The DTREE Procedure
The decision tree diagram produced by the TREEPLOT statement is shown in Output 7.4.1. As illustrated onthe decision tree, the program recommends that one should not conduct the research and development ofthe product if he or she is risk averse with a risk tolerance of $1,800,000. However, if he or she decides toundertake the research and development and it is a success, then he or she should commercialize the product.
Table 7.24 The Usage of SYMBOL Definitions
SYMBOL Definition Specification Description Used to DrawThe First C=blue Color All links except
L=1 Line Type those that indicateW=3 Thickness optimal decisionsC=blue Color Chance nodesF=marker FontH=2 HeightV=P Symbol
The Second CI=red Color All links thatL=1 Line Type indicate optimalW=3 Thickness decisionsCV=green Color Decision nodesF=marker FontH=2 HeightV=U Symbol
The Third CV=red Color End nodesF=marker FontH=2 HeightV=A Symbol
Example 7.5: Loan Grant Decision Problem F 463
Output 7.4.1 Research and Development Decision Tree
Example 7.5: Loan Grant Decision ProblemMany financial decisions are difficult to analyze because of the variety of available strategies and thecontinuous nature of the problem. However, if the alternatives and time frame can be restricted, then decisionanalysis can be a useful analysis tool.
For example, a loan officer is faced with the problem of deciding whether to approve or deny an applicationfor a one-year $30,000 loan at the current rate of 15% of interest. If the application is approved, the borrowerwill either pay off the loan in full after one year or default. Based on experience, the default rate is about 36out of 700. If the loan is denied, the money is put in government bonds at the interest rate of 8%.
To obtain more information about the applicant, the loan officer engages a credit investigation unit at acost of $500 per person that will give either a positive recommendation for making a loan or a negativerecommendation. Past experience with this investigator yields that of those who ultimately paid off theirloans, 570 out of 664 were given a positive recommendation. On the other hand, 6 out of 26 that had defaultedhad also been given a positive recommendation by the investigator.
The STAGEIN= data set, Stage6, gives the structure of the decision problem.
464 F Chapter 7: The DTREE Procedure
/* -- create the STAGEIN= data set -- */data Stage6;format _STNAME_ $14. _STTYPE_ $2. _OUTCOM_ $20. _SUCC_ $14. ;input _STNAME_ $ _STTYPE_ $ _OUTCOM_ & _SUCC_ $ ;datalines;Application D Approve loan Payment. . Deny loan .Payment C Pay off .. . Default .Investigation D Order investigation Recommendation. . Do not order ApplicationRecommendation C Positive Application. . Negative Application;
The PROBIN= data set Prob6 gives the probability distributions for the random events at the chance nodes.
/* -- create the PROBIN= data set -- */data Prob6;length _GIVEN_ _EVENT1_ _EVENT2_ $16;
_EVENT1_='Pay off'; _EVENT2_='Default';_PROB1_=664/700; _PROB2_=1.0-_PROB1_;output;
_GIVEN_='Pay off';_EVENT1_='Positive'; _EVENT2_='Negative';_PROB1_=570/664; _PROB2_=1.0-_PROB1_;output;
_GIVEN_='Default';_EVENT1_='Positive'; _EVENT2_='Negative';_PROB1_=6/26; _PROB2_=1.0-_PROB1_;output;
run;
The PAYOFFS= data set Payoff6 gives the payoffs for the various scenarios. Notice that the first observationin this data set indicates that if the officer denies the loan application, then payoffs are the interest from themoney invested in government bonds. The second and the third observations are redundant for the basicanalysis but are needed to determine the value of information as shown later.
/* -- create the PAYOFFS= data set -- */data Payoff6(drop=loan);length _STATE_ _ACT_ $24;
loan=30000;
_ACT_='Deny loan'; _VALUE_=loan*0.08; output;_STATE_='Pay off'; _VALUE_=loan*0.08; output;_STATE_='Default'; _VALUE_=loan*0.08; output;
_ACT_='Approve loan';_STATE_='Pay off'; _VALUE_=loan*0.15; output;_STATE_='Default'; _VALUE_=-1.0*loan; output;
run;
Example 7.5: Loan Grant Decision Problem F 465
The following code invokes the DTREE procedure to solve this decision problem.
/* -- define title -- */title 'Loan Grant Decision';
/* -- PROC DTREE statements -- */proc dtree
stagein=Stage6 probin=Prob6 payoffs=Payoff6summary target=investigation nowarning;
modify 'Order investigation' reward -500;
evaluate;
OPTIONS LINESIZE=85;summary / target=Application;OPTIONS LINESIZE=80;
Note that the $500 investigation fee is not included in the Stage6 data set. Since the outcome'Order investigation' is the only outcome that has a nonzero reward, it is easier to set the rewardfor this outcome using the MODIFY statement. The quotes that enclose the outcome name in the MODIFYstatement are necessary because the outcome name contains a space.
The results in Output 7.5.1 and Output 7.5.2 indicate that it is optimal to do the following:
� The loan officer should order the credit investigation and approve the loan application if the investigatorgives the applicant a positive recommendation. On the other hand, he should deny the application if anegative recommendation is given to the applicant.
� Furthermore, the loan officer should order a credit investigation if the cost for the investigation is lessthan $3; 725 � $2; 726 D $999:
Output 7.5.1 Summary of the Loan Grant Decision for Investigation
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 3225
466 F Chapter 7: The DTREE Procedure
Output 7.5.1 continued
Optimal Decision Policy
Up to Stage Investigation
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Order investigation -500 3725*
Do not order 0 2726
Output 7.5.2 Summary of the Loan Grant Decision for Application
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 3225
Optimal Decision Policy
Up to Stage Application
Alternatives or OutcomesCumulative
RewardEvaluating
Value
Order investigation Positive Approve loan -500 4004*
Order investigation Positive Deny loan -500 2400
Order investigation Negative Approve loan -500 -3351
Order investigation Negative Deny loan -500 2400*
Do not order Approve loan 0 2726*
Do not order Deny loan 0 2400
Now, the loan officer learns of another credit investigation company that claims to have a more accuratecredit checking system for predicting whether the applicants will default on their loans. However, he hasnot been able to find out what the company charges for their service or how accurate their credit checkingsystem is. Perhaps the best thing he can do at this stage is to assume that the company can predict perfectlywhether or not applicants will default on their loans and determine the maximum amount to pay for thisperfect investigation. The answer to this question can be found with the PROC DTREE statements:
Example 7.5: Loan Grant Decision Problem F 467
save;move payment before investigation;evaluate;recall;
Notice that moving the stage 'Payment' to the beginning of the tree means that the new decision treecontains two scenarios that are not in the original tree: the scenario 'Pay off' and 'Deny loan', and thescenario 'Default' and 'Deny loan'. The second and third observations in the Payoff6 data set supplyvalues for these new scenarios. If these records are not included in the PAYOFFS= data set, then PROCDTREE assumes they are 0.
Also notice that the SUMMARY and TARGET= options are specified globally in the PROC DTREE statementand hence are not needed in the EVALUATE statement. The results from the DTREE procedure are displayedin Output 7.5.3.
Output 7.5.3 Summary of the Loan Grant Decision with Perfect Information
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Payment Chance
Investigation Decision
Recommendation Chance
Application Decision
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 4392
Optimal Decision Policy
Up to Stage Investigation
Alternatives or OutcomesCumulative
RewardEvaluating
Value
Pay off Order investigation -500 4500
Pay off Do not order 0 4500*
Default Order investigation -500 2400
Default Do not order 0 2400*
The optimal decision summary in Output 7.5.3 shows that the yields with perfect investigation is $4,392.Recall that the yield of alternative 'Do not order' the investigation, as shown in Output 7.5.1, is $2,726.
468 F Chapter 7: The DTREE Procedure
Therefore, the maximum amount he should pay for the perfect investigation can be determined easily as
VPI D Value with Perfect Investigation �Value without InvestigationD $4; 392 � $2; 726D $1; 666
Note that if you use the VPI statement to determine the value of a perfect investigation, the result is differentfrom the value calculated previously.
vpi payment;
NOTE: The currently optimal decision yields 3225.4725275.NOTE: The new optimal decision yields 4392.NOTE: The value of perfect information of stage Payment
yields 1166.5274725.
The reason for this difference is that the VPI statement causes PROC DTREE first to determine the valuewith perfect information, then to compare this value with the value with current information available (in thisexample, it is the recommendation from the original investigation unit). Therefore, the VPI statement returnsa value that is calculated as
VPI D Value with Perfect Information �Value with Current InformationD $4; 392 � $3; 225D $1; 167
The loan officer considered another question regarding the maximum amount he should pay to a company tohelp collect the principal and the interest if an applicant defaults on the loan. This question is similar to thequestion concerning the improvement that can be expected if he can control whether or not an applicant willdefault on his loan (of course he will always want the applicant to pay off in full after one year). The answerto this question can be obtained with the following statements:
modify payment type;evaluate;
Example 7.5: Loan Grant Decision Problem F 469
Output 7.5.4 Summary of the Loan Grant Decision with Perfect Control
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Investigation Decision
Recommendation Chance
Application Decision
Payment Decision
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 4500
Optimal Decision Policy
Up to Stage Investigation
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Order investigation -500 4500
Do not order 0 4500*
The result is obvious and is shown in Output 7.5.4. Using a calculation similar to the one used to calculatethe value of a perfect investigation, the maximum amount one should pay for this kind of service is$4; 500 � $2; 726 D $1; 774: As previously described, this value is different from the value obtained byusing the VPC statement. In fact, if you specify the statement
vpc payment;
you get the value of VPC, which is $1,274.53, from the SAS log as
NOTE: The currently optimal decision yields 3225.4725275.NOTE: The new optimal decision yields 4500.NOTE: The value of perfect control of stage Payment yields
1274.5274725.
Obviously, all of the values of investigation and other services depend on the value of the loan. Since each ofthe payoffs for the various scenarios given in the Payoff6 data set is proportional to the value of loan, you cansafely assume that the value of the loan is 1 unit and determine the ratio of the value for a particular serviceto the value of the loan. To obtain these ratios, change the value of the variable LOAN to 1 in the Payoff6data set and invoke PROC DTREE again as follows:
470 F Chapter 7: The DTREE Procedure
/* -- create the alternative PAYOFFS= data set -- */data Payoff6a(drop=loan);
length _STATE_ _ACT_ $24;loan=1;
_ACT_='Deny loan'; _VALUE_=loan*0.08; output;_STATE_='Pay off'; _VALUE_=loan*0.08; output;_STATE_='Default'; _VALUE_=loan*0.08; output;
_ACT_='Approve loan';_STATE_='Pay off'; _VALUE_=loan*0.15; output;_STATE_='Default'; _VALUE_=-1.0*loan; output;
run;
/* -- PROC DTREE statements -- */title 'Loan Grant Decision';
proc dtreestagein=Stage6 probin=Prob6 payoffs=Payoff6anowarning;
evaluate / summary target=investigation;
save;move payment before investigation;evaluate;
recall;modify payment type;evaluate;
quit;
The optimal decision summary given in Output 7.5.5 shows that the ratio of the value of investigation that theloan officer currently engages in to the value of the loan is 0:1242 � 0:0909 D 0:0333 to 1.
Output 7.5.5 Summary of the Loan Grant Decision with 1 Unit Loan
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Example 7.5: Loan Grant Decision Problem F 471
Output 7.5.5 continued
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 0.1242
Optimal Decision Policy
Up to Stage Investigation
Alternatives orOutcomes
CumulativeReward
EvaluatingValue
Order investigation 0.1242*
Do not order 0.0909
The following messages are written to the SAS log:
NOTE: Present order of stages:
Investigation(D), Recommendation(C), Application(D),Payment(C), _ENDST_(E).
NOTE: The current problem has been successfully saved.
NOTE: Present order of stages:
Payment(C), Investigation(D), Recommendation(C),Application(D), _ENDST_(E).
NOTE: The currently optimal decision yields 0.1464.
NOTE: The original problem has been successfully recalled.
NOTE: Present order of stages:
Investigation(D), Recommendation(C), Application(D),Payment(C), _ENDST_(E).
NOTE: The type of stage Payment has been changed.
NOTE: The currently optimal decision yields 0.15.
The preceding messages show that the ratio of the value of perfect investigation to the value of a loan is0:1464 � 0:0909 D 0:0555 to 1, and the ratio of the maximum amount the officer should pay for perfectcontrol to the value of loan is 0:15 � 0:0909 D 0:591 to 1.
Output 7.5.6, produced by the following statements, shows a table of the values of the investigation currentlyengaged in, the values of perfect investigation, and the values of perfect control for loans ranging from$10,000 to $100,000.
/* create the data set for value of loan *//* and corresponding values of services */
data Datav6(drop=k ratio1 ratio2 ratio3);
472 F Chapter 7: The DTREE Procedure
label loan="Value of Loan"vci="Value of Current Credit Investigation"vpi="Value of Perfect Credit Investigation"vpc="Value of Perfect Collecting Service";
/* calculate ratios */ratio1=0.1242-0.0909;ratio2=0.1464-0.0909;ratio3=0.15-0.0909;
Loan=0;do k=1 to 10;
/* set the value of loan */loan=loan+10000;
/* calculate the values of various services */vci=loan*ratio1;vpi=loan*ratio2;vpc=loan*ratio3;
/* output current observation */output;
end;run;
/* print the table of the value of loan *//* and corresponding values of services */
title 'Value of Services by Value of Loan';
proc print label;format loan vci vpi vpc dollar12.0;
run;
Output 7.5.6 Values of Loan and Associated Values of Service
Value of Services by Value of LoanValue of Services by Value of Loan
ObsValue of
Loan
Value ofCurrent
CreditInvestigation
Value ofPerfectCredit
Investigation
Value ofPerfect
CollectingService
1 $10,000 $333 $555 $591
2 $20,000 $666 $1,110 $1,182
3 $30,000 $999 $1,665 $1,773
4 $40,000 $1,332 $2,220 $2,364
5 $50,000 $1,665 $2,775 $2,955
6 $60,000 $1,998 $3,330 $3,546
7 $70,000 $2,331 $3,885 $4,137
8 $80,000 $2,664 $4,440 $4,728
9 $90,000 $2,997 $4,995 $5,319
10 $100,000 $3,330 $5,550 $5,910
Example 7.6: Petroleum Distributor’s Decision Problem F 473
Example 7.6: Petroleum Distributor’s Decision ProblemThe president of a petroleum distribution company currently faces a serious problem. His company suppliesrefined products to its customers under long-term contracts at guaranteed prices. Recently, the price forpetroleum has risen substantially and his company will lose $450,000 this year because of its long-termcontract with a particular customer. After a great deal of discussion with his legal advisers and his marketingstaff, the president learns that the contract contains a clause that may be beneficial to his company. Theclause states that when circumstances are beyond its control, the company may ask its customers to pay theprevailing market prices for up to 10% of the promised amount.
Several scenarios are possible if the clause is invoked. If the customer accepts the invocation of the clauseand agrees to pay the higher price for the 10%, the company would turn a loss of $450,000 into a net profit of$600,000. If the customer does not accept the invocation, the customer may sue for damages or accept asettlement of $900,000 (resulting in a loss of $400,000) or simply decline to press the issue. In any case,the distribution company could then sell the 10% on the open market for an expected value of $500,000.However, the lawsuit would result in one of three possible outcomes: the company wins and pays no damages;the company loses and pays normal damages of $1,500,000; the company loses and pays double damages of$3,000,000. The lawyers also feel that this case might last three to five years if the customer decides to suethe company. The cost of the legal proceedings is estimated as $30,000 for the initial fee and $20,000 peryear. The likelihood of the various outcomes are also assessed and reported as in Table 7.25. Suppose thatthe company decides to use a discount rate of 10% to determine the present value of future funds.
Table 7.25 Likelihood of the Outcomes in the Petroleum Distributor’s Decision
Uncertainty Outcome ProbabilityCustomer’s Response Accept the Invocation 0.1
Reject the Invocation 0.9Customer’s Action Press the Issue 0.1
if the Invocation Settle the Case 0.45is being Rejected Sue for Damages 0.45
Case Last 3 Years 0.34 Years 0.45 Years 0.3
Lawsuit Result Pay No Damages 0.15Pay Normal Damages 0.65Pay Double Damages 0.2
The structure for this decision problem is given in the STAGEIN= data set named Stage7.
/* -- create the STAGEIN= data set -- */data Stage7;
format _OUTCOM1 $14. _OUTCOM2 $14. ;input _STNAME_ $ _STTYPE_ $ _OUTCOM1 $
_SUCC1 $ _OUTCOM2 $ _SUCC2 $ ;datalines;
Action D Invoking Response Not_Invoking .Response C Accept . Refuse LawsuitLawsuit C Press_Issue . Settle .. . Sue Last . .
474 F Chapter 7: The DTREE Procedure
Last C 3_Years Result 4_Years Result. . 5_Years Result . .Result C No_Damages . Normal_Damages .. . Double_Damages . . .;
The PROBIN= data set Prob7 contains the probability distributions for the chance nodes.
/* -- create the PROBIN= data set -- */data Prob7;
format _EVENT1_ _EVENT2_ $14.;input _EVENT1_ $ _PROB1_ _EVENT2_ $ _PROB2_ ;datalines;
Accept 0.1 Refuse 0.9Press_Issue 0.1 Settle 0.45Sue 0.45 . .3_Years 0.3 4_Years 0.45_Years 0.3 . .No_Damages 0.15 Normal_Damages 0.65Double_Damages 0.20 . .;
The PAYOFFS= data set Payoff7 defines the payoffs for the various scenarios.
/* -- create the PAYOFFS= data set -- */data Payoff7(drop=i j k D PCOST);
length _ACTION_ _STATE1-_STATE4 $16;
/* possible outcomes for the case last */array YEARS{3} $16. _TEMPORARY_ ('3_Years',
'4_Years','5_Years' );
/* numerical values for the case last */array Y{3} _TEMPORARY_ (3, 4, 5);
/* possible outcomes for the size of judgment */array DAMAGES{3} $16. _TEMPORARY_ ('No_Damages',
'Normal_Damages','Double_Damages' );
/* numerical values for the size of judgment */array C{3} _TEMPORARY_ (0, 1500, 3000);
D=0.1; /* discount rate */
/* payoff for the scenario which the *//* 10 percent clause is not invoked */
_ACTION_='Not_Invoking'; _VALUE_=-450; output;
/* the clause is invoked */_ACTION_='Invoking';
/* payoffs for scenarios which the clause is *//* invoked and the customer accepts the *//* invocation */
Example 7.6: Petroleum Distributor’s Decision Problem F 475
_STATE1='Accept'; _VALUE_=600; output;
/* the customer refuses the invocation */_STATE1='Refuse';
/* payoffs for scenarios which the clause is *//* invoked and the customer refuses the *//* invocation but decline to press the issue */
_STATE2='Press_Issue'; _VALUE_=500; output;
/* payoffs for scenarios which the clause is *//* invoked and the customer refuses the *//* invocation but willing to settle out of *//* court for 900K */
_STATE2='Settle'; _VALUE_=500-900; output;
/* the customer will sue for damages */_STATE2='Sue';do i=1 to 3;
_STATE3=YEARS{i};
/* determine the cost of proceedings */PCOST=30; /* initial cost of the proceedings */
/* additional cost for every years in *//* in present value */
do k=1 to Y{i};PCOST=PCOST+(20/((1+D)**k));
end;
/* loop for all poss. of the lawsuit result */do j=1 to 3;
_STATE4=DAMAGES{j}; /* the damage have to paid */
/* compute the net return in present value */_VALUE_=500-PCOST-(C{j}/((1+D)**Y{i}));
/* output an observation for the payoffs *//* of this scenario */
output;end;
end;
run;
/* -- print the payoff table -- */title "Petroleum Distributor's Decision";title3 "Payoff Table";
proc print;run;
476 F Chapter 7: The DTREE Procedure
The payoff table of this problem is displayed in Output 7.6.1.
Output 7.6.1 Payoffs for the Petroleum Distributor’s Problem
Petroleum Distributor's Decision
Payoff Table
Petroleum Distributor's Decision
Payoff Table
Obs _ACTION_ _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
1 Not_Invoking -450.00
2 Invoking Accept 600.00
3 Invoking Refuse Press_Issue 500.00
4 Invoking Refuse Settle -400.00
5 Invoking Refuse Sue 3_Years No_Damages 420.26
6 Invoking Refuse Sue 3_Years Normal_Damages -706.71
7 Invoking Refuse Sue 3_Years Double_Damages -1833.68
8 Invoking Refuse Sue 4_Years No_Damages 406.60
9 Invoking Refuse Sue 4_Years Normal_Damages -617.92
10 Invoking Refuse Sue 4_Years Double_Damages -1642.44
11 Invoking Refuse Sue 5_Years No_Damages 394.18
12 Invoking Refuse Sue 5_Years Normal_Damages -537.20
13 Invoking Refuse Sue 5_Years Double_Damages -1468.58
Note that the payoffs of the various scenarios in Output 7.6.1 are in thousands of dollars and are net presentvalues (NPV) (Baird 1989). For example, the payoff for the following scenario “invoking the clause; thecustomer refuses to accept this and sues for damages; the case lasts four years and the petroleum distributioncompany loses and pays double damages” is calculated as
Payoff D 500 � NPV of proceedings cost
� NPV of damages of 3; 000; 000
D �1642:44
where
NPV of proceedings cost D 30C4X
kD1
20=.1C 0:1/k
and
NPV of damages of 3; 000; 000 D 3000=.1C 0:1/4
This is because the company can sell the 10% for $500,000 immediately and pay the $3,000,000 damagesfour years from now. The net present value of the proceedings is determined by paying the $30,000 initial feenow and a fee of $20,000 after every year up to four years. The value of 0.1 is the discount rate used.
Example 7.6: Petroleum Distributor’s Decision Problem F 477
The following statements evaluate the problem and plot the optimal solution.
/* -- define graphics options -- */goptions colors=(green red blue);goptions hsize=8 in vsize=8.4 in;
/* -- define title -- */title h=2.5 "Petroleum Distributor's Decision";
/* -- PROC DTREE statements -- */proc dtree stagein=Stage7 probin=Prob7 payoffs=Payoff7;
evaluate / summary;treeplot / graphics compress nolg name="dt6p1" ftext='Cumberland AMT'
ybetween=1 cell lwidth=2 lwidthb=3 hsymbol=3;quit;
The optimal decision summary in Output 7.6.2 suggests that the president should invoke the 10% clausebecause it would turn a loss of $450,000 into an expected loss of $329,000 in present value.
Output 7.6.2 Summary of the Petroleum Distributor’s Decision
Petroleum Distributor's Decision
The DTREE Procedure
Optimal Decision Summary
Petroleum Distributor's Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
Action Decision
Response Chance
Lawsuit Chance
Last Chance
Result Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: -329
Optimal Decision Policy
Up to Stage Action
Alternativesor Outcomes
CumulativeReward
EvaluatingValue
Invoking -329*
Not_Invoking -450
The decision tree for this problem is shown in Output 7.6.3. There you can find the expected value of eachscenario.
478 F Chapter 7: The DTREE Procedure
Output 7.6.3 Decision Tree for the Petroleum Distributor’s Decision
Example 7.6: Petroleum Distributor’s Decision Problem F 479
The president feels that the estimated likelihood of lawsuit outcomes is fairly reliable. However, theassessment of the likelihood of the customer’s response and reaction is extremely difficult to estimate.Because of this, the president would like to keep the analysis as general as possible. His staff suggestsusing the symbols p and q to represent the probability that the customer will accept the invocation and theprobability that the customer will decline to press the issue if he refuses the invocation, respectively. Theprobabilities of the other possible outcomes about the customer’s response and reaction to the invocation ofthe 10% clause are listed in Table 7.26.
Table 7.26 Probabilities of the Petroleum Distributor’s Decision
Uncertainty Outcome ProbabilityCustomer’s Response Accept the Invocation p
Reject the Invocation 1 - pCustomer’s Action Press the Issue q
if the Invocation Settle the Case .1 � q/=2
is being Rejected Sue for Damages .1 � q/=2
Now from the decision tree shown in Output 7.6.3, the expected value of the outcome 'Refuse' is
EV D 500q � 400.1 � q/=2 � 672.1 � q/=2
D 500q � 200C 200q � 336C 336q
D 1036q � 536
Hence, the expected payoff if the petroleum distribution company invokes the clause is
EV D 600p C .1036q � 536/.1 � p/
D 1136p C 1036q � 1036pq � 536
D 1136p C 1036.1 � p/q � 536
Therefore, the president should invoke the 10% clause if
1136p C 1036.1 � p/q � 536 > �450
or
q >86 � 1136p
1036 � 1036p
480 F Chapter 7: The DTREE Procedure
This result is depicted in Output 7.6.4, which is produced by the following statements:
/* -- create data set for decision diagram -- */data Data7(drop=i);
P=0.0; /* initialize P */
/* loop for all possible values of P */do i=1 to 21;
/* determine the corresponding Q */Q=(86-(1136*P))/(1036*(1.0-P));if Q < 0.0 then Q=0.0;
/* output this data point */output;
/* set next possible value of P */P=P+0.005;
end;
run;
/* create the ANNOTATE= data set for labels of *//* decision diagram */
data label;length FUNCTION STYLE COLOR $8;length XSYS YSYS $1;length WHEN POSITION $1;length X Y 8;length SIZE ROTATE 8;
WHEN = 'A';POSITION='0';XSYS='2';YSYS='2';input FUNCTION $ X Y STYLE $ SIZE COLOR $
ROTATE TEXT $ & 16.;datalines;
label 0.01 0.04 centx 2 black . Do Notlabel 0.01 0.03 centx 2 black . Invokelabel 0.01 0.02 centx 2 black . The Clauselabel 0.06 0.06 centx 2 black . Invoke Thelabel 0.06 0.05 centx 2 black . Clause;
/* -- define symbol characteristics for boundary -- */symbol1 i=joint v=NONE l=1 ci=black;
/* -- define pattern for area fill -- */pattern1 value=msolid color=cyan;pattern2 value=msolid color=green;
/* -- define axis characteristics -- */axis1 label=('Pr(Accept the Invocation)')
Example 7.6: Petroleum Distributor’s Decision Problem F 481
order=(0 to 0.1 by 0.01) minor=none;axis2 label=(angle=90 'Pr(Press the Issue)')
order=(0 to 0.1 by 0.01) minor=none;
/* -- plot decision diagram -- */title h=2.5 "Petroleum Distributor's Decision";proc gplot data=Data7 ;
plot Q*P=1 / haxis=axis1vaxis=axis2annotate=labelname="dt6p2"frameareas=2;
run;quit;
Output 7.6.4 Decision Diagram for the Petroleum Distributor’s Problem
482 F Chapter 7: The DTREE Procedure
The decision diagram in Output 7.6.4 is an analysis of the sensitivity of the solution to the probabilities thatthe customer will accept the invocation and that the customer will decline to press the issue. He should invokethe clause if he feels the customer’s probabilities of outcomes 'Accept' and 'Press_Issue', p and q, arelocated in the upper-right area marked as 'Invoke The Clause' in Output 7.6.4 and should not invoke theclause otherwise. Note that the values p = 0.1 and q = 0.1 used in this example are located on the upper rightcorner on the diagram.
Statement and Option Cross-Reference TablesThe following tables reference the statements and options in the DTREE procedure (except the PROC DTREEstatement and the QUIT statement) that are illustrated by the examples in this section.
Table 7.27 Statements Specified in Examples
Statement 1 2 3 4 5 6EVALUATE X X X X X XMODIFY XMOVE XRECALL XRESET XSAVE XSUMMARY X X XTREEPLOT X X XVARIABLES XVPC XVPI X
Statement and Option Cross-Reference Tables F 483
Table 7.28 Options Specified in Examples
Option 1 2 3 4 5 6ANNOTATE= XCOMPRESS X X XCRITERION= X X XEVENT= XFTEXT= X XGRAPHICS X X XHSYMBOL= X XLINKA= XLINKB= XLINKC=LSTYLEB= XLWIDTH= X XLWIDTHB= X XNAME= X X XNOLEGEND X XNOWARNING X X X XOUTCOME= XPAYOFFS= X X X X X XPROB= XPROBIN= X X X X X XREWARD= XRT= X X XSTAGE= XSTAGEIN= X X X X X XSTATE= XSUCCESSOR= XSUMMARY X XSYMBOLC= XSYMBOLD= XSYMBOLE= XTARGET= X X XTYPE= XVALUE=YBETWEEN= X X
484 F Chapter 7: The DTREE Procedure
References
Baird, B. F. (1989). Managerial Decisions under Uncertainty: An Introduction to the Analysis of DecisionMaking. New York: John Wiley & Sons.
Howard, R. A. (1968). “The Foundations of Decision Analysis.” IEEE Transactions on System Science andCybernetics SSC-4:211–219.
Howard, R. A. (1988). “Decision Analysis: Practice and Promise.” Management Science 34:679–695.
Kuhfeld, W. F. (2010). Statistical Graphics in SAS: An Introduction to the Graph Template Language and theStatistical Graphics Procedures. Cary, NC: SAS Institute Inc.
Raiffa, H. (1970). Decision Analysis Introductory Lectures on Choices under Uncertainty. Reading, MA:Addison-Wesley.
Subject Index
_ACT variables, see ACTION variablesPayoff data set (DTREE), 419
ACTION variablesPayoff data set (DTREE), 419
actions, decision stage, 384alternatives, decision stage, 384Annotate data set
DTREE procedure, 405processing (DTREE), 407suppress processing (DTREE), 407
Annotate facilitydrawing legend of decision tree diagram, 461DTREE procedure, 460
attitudes toward risk, 390
certain equivalentcalculation, 428DTREE procedure, 401, 425, 426exponential utility function, 426
chance nodescharacter, 410color, 405, 410font, 410height, 410symbol, 411
chance stagedecision tree model, 384outcomes, 384probabilities, 384
character specification, see symbol specificationchance nodes (DTREE), 410decision nodes (DTREE), 410end nodes (DTREE), 411
CIRCLE, special symbol tableDTREE procedure, 411
color specificationchance nodes (DTREE), 405, 410decision nodes (DTREE), 406, 410end nodes (DTREE), 406, 411links of optimal decisions (DTREE), 405, 408links on decision tree (DTREE), 405, 408symbol (DTREE), 405, 406, 410, 411text (DTREE), 406
compress in graphics modedecision tree diagram, 405, 456
computer resource requirementsDTREE procedure, 437
conditional probability, 384
contract bidding decision problem, 454corners, rectangular
decision tree diagram, 410corners, rounded
decision tree diagram, 410corporate risk tolerance, 427
assessing, 427estimating, 427
COST variables, see REWARD variablesCOST= option, see REWARD= optioncumulative reward, 423
on decision tree diagram, 402, 415optimal decision summary, 403
decision criterion, 401specifying, 391
decision model, see decision tree modeldecision nodes
character, 410color, 406, 410font, 410height, 410symbol, 411
decision stagedecision tree model, 384outcomes, 384
decision tree diagramcumulative reward, 402, 415displaying, 385, 389, 415, 425, 429drawing on one page, 405, 456evaluating value, 402, 415graphics version, 431information displayed, 402, 416labels, 402, 416line-printer version, 431number of pages, 430outcome name, 402, 415page format, 429probability, 402, 415reward, 402, 415stage name, 402, 415
decision tree model, 384difference between rewards and payoffs, 421evaluating, 385, 389modifying, 385outcomes, 384recalling, 385, 414representing, 403
saving, 385, 415, 425scenario, 415stages, 384
discount rateexample (DTREE), 473
displayinformation in decision tree diagram, 402, 415
displayed outputDTREE procedure, 428
DOT, special symbol tableDTREE procedure, 411
DTREE examples, 437contract bidding decision problem, 454loan grant decision problem, 463oil wildcatter’s decision problem, 438, 443petroleum distributor’s decision problem, 473research and development decision problem, 459
DTREE procedurecomputer resource requirements, 437displayed output, 428displaying decision tree, 429error handling, 436evaluating decision tree, 425functional summary, 398general options, 401–404graphics options, 405–411Imagemap data set, 408, 433input data sets, 420interactivity, 424line-printer options, 412missing values, 423ODS style template, 434ODS table names, 434options classified by function, 398output data sets, 385Output Delivery System (ODS), 385overview, 384syntax skeleton, 397table of syntax elements, 398terminating, 385, 414, 424variables, 417–419
end nodescharacter, 411color, 406, 411font, 411height, 411symbol, 411
end stagedecision tree model, 384
equityestimating corporate risk tolerance, 427
errorsDTREE procedure, 402, 422–425, 437
evaluating valuedecision tree diagram, 402DTREE procedure, 419, 426on decision tree diagram, 402, 415on optimal decision summary, 403optimal, 413represented with Payoff data set (DTREE), 403selecting the best alternative, 428
_EVEN variables, see EVENT variablesProbability data set (DTREE), 418
EVENT variablesProbability data set (DTREE), 418
events, 384examples, see DTREE examples
statement and option cross-reference tables(DTREE), 482
expected utility, DTREE procedure, 425expected value, DTREE procedure, 425, 426exponential utility function
DTREE procedure, 390, 401, 426, 428example (DTREE), 442
financial decisions, see loan grant decision problemfont specification, see symbol specification
chance nodes (DTREE), 410decision nodes (DTREE), 410end nodes (DTREE), 411symbol (DTREE), 410, 411text (DTREE), 407
font, hardwarefor text on decision tree, 407
format control optionsDTREE procedure, 403, 430
formattingnumerical values on decision tree diagram, 403outcome names on decision tree diagram, 403
functional summaryDTREE procedure, 398
future certain equivalent value, see evaluating valuefuture funds
example (DTREE), 473
general optionsDTREE procedure, 401–404
_GIVE variables, see GIVEN variablesProbability data set (DTREE), 418
GIVEN variablesProbability data set (DTREE), 418
global graphics optionscolor of symbol, 405, 406color of text, 406controlling the appearance of decision tree, 431,
459font of text, 407
height, 407number of columns, 431number of rows, 431unit of measure, 404
global optionsDTREE procedure, 424
graphics catalogDTREE procedure, 407
graphics versionexample (DTREE), 454options specific to (DTREE), 405–411
hardware fontfor text on decision tree, 407
height specificationchance nodes (DTREE), 410decision nodes (DTREE), 410end nodes (DTREE), 411nodes on decision tree (DTREE), 407symbol (DTREE), 407, 410, 411text (DTREE), 407
Imagemap data setDTREE procedure, 385
input data sets, see Probability data set, see Stage dataset, see Payoff data set, see Annotate dataset, see Payoff data set, see Probability dataset, see Stage data set, see Payoff data set,see Probability data set, see Stage data set
DTREE procedure, 384, 385, 417, 420interactivity
DTREE procedure, 424
labels on decision tree diagram, 402, 415displaying, 402suppress displaying, 402, 416
legendcustomized with Annotate data set (DTREE), 405,
461on decision tree diagram, 408suppress displaying (DTREE), 408
line-printer versionoptions specific to (DTREE), 412
line style specificationlinks across pages (DTREE), 408, 409links of optimal decisions (DTREE), 408, 409links on decision tree (DTREE), 408, 409
line width specificationlinks of optimal decisions (DTREE), 408, 409links on decision tree (DTREE), 408, 409
linear utility function, 426links across pages
color, 408style, 409thickness, 408
type, 408, 409links of optimal decisions
color, 405, 408style, 409thickness, 408, 409type, 408, 409
links on decision treecolor, 405, 408style, 409thickness, 408, 409type, 408, 409
litigation decisions, see petroleum distributor’sdecision problem
loan grant decision problem, 463local options
DTREE procedure, 424LOSS variables, see VALUE variables
machine epsilon, 404missing values
DTREE procedure, 423, 424most likely value, DTREE procedure, 425multiple pages
displaying decision tree diagram, 429
net incomeestimating corporate risk tolerance, 427
net present value, 476net sales
estimating corporate risk tolerance, 427nodes on decision tree, 399, see chance nodes, see
decision nodes, see end nodesNPV, see net present valuenumber of columns, global graphics options
DTREE procedure, 431number of pages
displaying decision tree diagram, 430number of rows, global graphics options
DTREE procedure, 431numerical precision, DTREE procedure, 436
oil wildcatter’s decision problem, 420, 425a risk-averse setting, 443an insurance option, 438example, 385sounding test option, 393value of perfect control, 392value of perfect information, 391
optimal decisiondetermining, 391
optimal decision summarydisplaying, 385, 389, 403, 415, 424, 428example, 389, 394, 422, 423suppress displaying, 403
optimal evaluating value, 413
optionsnot changed, 414resetting, 385, 414, 424specified on multiple statements, 424
options classified by function, see functional summaryorder of stages
determining, 425limitations to modifying, 414modifying, 385, 414, 425structuring decision problems, 424
order of statementsDTREE procedure, 424
_OUT variables, see OUTCOME variablesStage data set (DTREE), 417
outcome nameon decision tree diagram, 402, 415
OUTCOME variablesStage data set (DTREE), 417
outcomeschance stage, 384decision stage, 384decision tree model, 384name, 384reward, 384successor, 384
output data sets, see Imagemap data setDTREE procedure, 385
Output Delivery System (ODS)DTREE procedure, 385, 434DTREE style template, 434table names, 434
overviewDTREE procedure, 384
pagedrawing decision tree on a single, 405, 456format of decision tree diagram, 429
page numberson decision tree diagram, 410suppress displaying (DTREE), 410
pagesneeded in displaying decision tree diagram, 430
Payoff data setDTREE procedure, 385, 403, 420, 421example, 387redundant observations, 464variables, 419
payoffsdecision tree model, 421different from rewards, 421warning if unassigned, 404
PAYOFFS variables, see VALUE variablespetroleum distributor’s decision problem, 473preference, DTREE procedure, 425
PROB variablesProbability data set (DTREE), 419
_PROB variables, see PROB variablesProbability data set (DTREE), 419
probabilitiesdecision tree model, 384do not sum to 1, 401on decision tree diagram, 402, 415scaled by DTREE procedure, 401warning when rescaled, 404
Probability data setDTREE procedure, 384, 403, 420, 421, 423example, 387variables, 418, 419
rectangular cornersdecision tree diagram, 410
rescale probabilitiesDTREE procedure, 401warning in DTREE procedure, 404
research and development decision problem, 459_REW variables, see REWARD variables
Stage data set (DTREE), 417REWARD variables
Stage data set (DTREE), 417, 421, 422rewards
decision tree model, 421different from payoffs, 421label on decision tree diagram, 402modifying, 413on decision tree diagram, 402, 415
risk, 426risk averse, 442, 443risk aversion
coefficient, 426DTREE procedure, 426
risk toleranceDTREE procedure, 390, 426, 427estimation, 426example (DTREE), 442, 443specifying, 391, 403, 428
rounded cornersdecision tree diagram, 410
RT, see risk tolerance
SAS catalogs, see graphics catalogSAS data sets
DTREE procedure, 384–386, 420scenario of decision tree, 384, 415spacing between
two successive end nodes, 404special symbol table
DTREE procedure, 411SQUARE, special symbol table
DTREE procedure, 411Stage data set
DTREE procedure, 384, 403, 420–422, 425example, 386variables, 417, 418
stage nameon decision tree diagram, 402, 415
stage typemodifying, 413
STAGE variableStage data set (DTREE), 417
stageschance, 384decision, 384decision tree model, 384end, 384name, 384order, 414, 424, 425outcomes, 384type, 384, 413
_STAT variables, see STATE variablesPayoff data set (DTREE), 419
STATE variablesPayoff data set (DTREE), 419
statement orderDTREE procedure, 424
_STNAME_ variable, see STAGE variableStage data set (DTREE), 417
straight-line utility function, 403_STTYPE_ variable, see TYPE variable
Stage data set (DTREE), 418style of lines, see line style specification_SUCC variables, see SUCCESSOR variables
Stage data set (DTREE), 418SUCCESSOR variables
Stage data set (DTREE), 418symbol specification
chance nodes (DTREE), 410, 411controlling the appearance of decision tree, 431decision nodes (DTREE), 410, 411DTREE procedure, 408–411end nodes (DTREE), 411example (DTREE), 459, 461identifying symbols for links on decision tree, 408identifying symbols for nodes on decision tree,
410, 411syntax skeleton
DTREE procedure, 397
textcolor (DTREE), 406font (DTREE), 407height (DTREE), 407
thickness of lines, see line width specification
total probabilityDTREE procedure, 401is not equal to 1, 401
type of lines, see line style specificationTYPE variable
Stage data set (DTREE), 418
unassigned payoffswarning in DTREE procedure, 404
uncertain factorrepresented as chance stage, 384
uncertainty, decision tree model, 384, 425, 426unconditional probability
DTREE procedure, 385unit of measure, global graphics options
DTREE procedure, 404units of vertical space
DTREE procedure, 404graphics version (DTREE), 404line-printer version, 404
utility, 425utility curve, 401, 425utility function
DTREE procedure, 390, 425, 426exponential, 390, 401, 426, 428straight-line, 403, 426
utility value, 425UTILITY variables, see VALUE variables
_VALU variables, see VALUE variablesPayoff data set (DTREE), 419
value of imperfect information, see value of sampleinformation
value of perfect control, 392, 420evaluating, 385, 392, 468, 469misleading, 469oil wildcatter’s decision problem, 392
value of perfect information, 391, 420evaluating, 385, 391, 392, 425, 468misleading, 468oil wildcatter’s decision problem, 391
value of sample information, 395evaluating, 396
VALUE variablesPayoff data set (DTREE), 419
variableslist of, DTREE procedure, 417treatment of missing values (DTREE), 423
vertical spacebetween two end nodes (DTREE), 404units (DTREE), 404
warningsuppress displaying (DTREE), 404, 422
Web-enabled decision tree, 408, 418, 433
WEB variableImagemap data set (DTREE), 408Stage data set (DTREE), 418, 433
width of lines, see line width specification
Syntax Index
ACTION= optionVARIABLES statement (DTREE), 419
AFTER keywordMOVE statement (DTREE), 414
ALL keywordDISPLAY= option (DTREE), 402
ANNO= option, see ANNOTATE= optionANNOTATE= option
PROC DTREE statement, 405, 461TREEPLOT statement (DTREE), 416
AUTOSCALE optionPROC DTREE statement, 401
BEFORE keywordMOVE statement (DTREE), 414
CB= option, see CBEST= optionCBEST= option
PROC DTREE statement, 405TREEPLOT statement (DTREE), 416
CC= option, see CSYMBOLC= optionCD= option, see CSYMBOLD= optionCE= option, see CSYMBOLE= optionCELL units
YBETWEEN= option (DTREE), 404CHANCE keyword
TYPE variable (DTREE), 418CL= option, see CLINK= optionCLINK= option
PROC DTREE statement, 405TREEPLOT statement (DTREE), 416
CM unitsYBETWEEN= option (DTREE), 404
COMPRESS optionPROC DTREE statement, 405TREEPLOT statement (DTREE), 416, 457, 461,
477CP option, see COMPRESS optionCR keyword
DISPLAY= option (DTREE), 402CRITERION= option
EVALUATE statement (DTREE), 413PROC DTREE statement, 401, 450, 461RESET statement (DTREE), 442
CSYMBOLC= optionPROC DTREE statement, 405TREEPLOT statement (DTREE), 416
CSYMBOLD= optionPROC DTREE statement, 406
TREEPLOT statement (DTREE), 416CSYMBOLE= option
PROC DTREE statement, 406TREEPLOT statement (DTREE), 416
CT= option, see CTEXT= optionCTEXT= option
PROC DTREE statement, 406TREEPLOT statement (DTREE), 416
DECISION keywordTYPE variable (DTREE), 418
DES= option, see DESCRIPTION= optionDESCRIPTION= option
PROC DTREE statement, 406TREEPLOT statement (DTREE), 416
DISPLAY= optionPROC DTREE statement, 402TREEPLOT statement (DTREE), 416
DOANNO option, see DOANNOTATE optionDOANNOTATE option
PROC DTREE statement, 407TREEPLOT statement (DTREE), 416
DRAIN keywordERRHANDLE= option (DTREE), 402
DTREE procedure, 397EVALUATE statement, 413MODIFY statement, 413MOVE statement, 414PROC DTREE statement, 401QUIT statement, 414RECALL statement, 414RESET statement, 414SAVE statement, 415SUMMARY statement, 415TREEPLOT statement, 415VARIABLES statement, 416VPC statement, 419VPI statement, 420
END keywordTYPE variable (DTREE), 418
ERRHANDLE= optionPROC DTREE statement, 402
EV keywordDISPLAY= option (DTREE), 402
EVALUATE statementDTREE procedure, 413
EVENT= optionVARIABLES statement (DTREE), 418, 441
FONT= option, see FTEXT= optionFORMCHAR= option
PROC DTREE statement, 412TREEPLOT statement (DTREE), 416
FTEXT= optionPROC DTREE statement, 407TREEPLOT statement (DTREE), 416, 457, 477
GIVEN= optionVARIABLES statement (DTREE), 418
GOUT= optionPROC DTREE statement, 407TREEPLOT statement (DTREE), 416
GRAPHICS optionPROC DTREE statement, 402, 457, 461TREEPLOT statement (DTREE), 416, 477
HS= option, see HSYMBOL= optionHSYMBOL= option
PROC DTREE statement, 407TREEPLOT statement (DTREE), 416, 457, 477
HT= option, see HTEXT= optionHTEXT= option
PROC DTREE statement, 407TREEPLOT statement (DTREE), 416
HTML= option, see WEB= option
IMAGEMAP= optionPROC DTREE statement, 408, 433TREEPLOT statement (DTREE), 416
INCH unitsYBETWEEN= option (DTREE), 404
L= option, see LSTYLE= optionLABEL option
PROC DTREE statement, 402TREEPLOT statement (DTREE), 416
LB= option, see LSTYLEB= optionLC= option, see LSTYLEC= optionLEGEND option
PROC DTREE statement, 408TREEPLOT statement (DTREE), 416
LG option, see LEGEND optionLINEPRINTER option
PROC DTREE statement, 403TREEPLOT statement (DTREE), 416
LINK keywordDISPLAY= option (DTREE), 402
LINKA= optionPROC DTREE statement, 408TREEPLOT statement (DTREE), 416, 461
LINKB= optionPROC DTREE statement, 408TREEPLOT statement (DTREE), 416, 461
LINKC= option
PROC DTREE statement, 408TREEPLOT statement (DTREE), 416
LOSS= option, see VALUE= optionLP option, see LINEPRINTER optionLSTYLE= option
PROC DTREE statement, 409TREEPLOT statement (DTREE), 416
LSTYLEB= optionPROC DTREE statement, 409TREEPLOT statement (DTREE), 416, 457
LSTYLEC= optionPROC DTREE statement, 409TREEPLOT statement (DTREE), 416
LTHICK= option, see LWIDTH= optionLTHICKB= option, see LWIDTHB= optionLWIDTH= option
PROC DTREE statement, 409TREEPLOT statement (DTREE), 416, 457, 477
LWIDTHB= optionPROC DTREE statement, 409TREEPLOT statement (DTREE), 416, 457, 477
MAXCE keywordCRITERION= option (DTREE), 401, 403
MAXEV keywordCRITERION= option (DTREE), 401
MAXMLV keywordCRITERION= option (DTREE), 401
MAXPREC= optionEVALUATE statement (DTREE), 413PROC DTREE statement, 403SUMMARY statement (DTREE), 415TREEPLOT statement (DTREE), 416
MAXWIDTH= optionEVALUATE statement (DTREE), 413PROC DTREE statement, 403SUMMARY statement (DTREE), 415TREEPLOT statement (DTREE), 416
MINCE keywordCRITERION= option (DTREE), 401, 403
MINEV keywordCRITERION= option (DTREE), 401
MINMLV keywordCRITERION= option (DTREE), 401
MODIFY statementDTREE procedure, 413, 465, 468, 470
MOVE statementDTREE procedure, 414, 467
NAME= optionPROC DTREE statement, 410TREEPLOT statement (DTREE), 416, 457
NOANNO option, see NOANNOTATE optionNOANNOTATE option
PROC DTREE statement, 407TREEPLOT statement (DTREE), 416
NOCOMPRESS optionPROC DTREE statement, 405TREEPLOT statement (DTREE), 416
NOCP option, see NOCOMPRESS optionNOLABEL option
PROC DTREE statement, 402TREEPLOT statement (DTREE), 416
NOLEGEND optionPROC DTREE statement, 408, 461TREEPLOT statement (DTREE), 416, 477
NOLG option, see NOLEGEND optionNOPAGENUM option
PROC DTREE statement, 410TREEPLOT statement (DTREE), 416
NOPAGENUMBER option, see NOPAGENUM optionNORC option
PROC DTREE statement, 410TREEPLOT statement (DTREE), 416
NOSCALE optionPROC DTREE statement, 401
NOSUMMARY optionEVALUATE statement (DTREE), 413PROC DTREE statement, 403
NOWARNING optionPROC DTREE statement, 404
NWIDTH= optionEVALUATE statement (DTREE), 413PROC DTREE statement, 403SUMMARY statement (DTREE), 415TREEPLOT statement (DTREE), 416
OUTCOME= optionVARIABLES statement (DTREE), 417, 441
P keywordDISPLAY= option (DTREE), 402
PAGENUM optionPROC DTREE statement, 410TREEPLOT statement (DTREE), 416
PAGENUMBER option, see PAGENUM optionPAYOFFS= option, see VALUE= option
PROC DTREE statement, 403PCT units
YBETWEEN= option (DTREE), 404PROB= option
VARIABLES statement (DTREE), 419, 441PROBIN= option
PROC DTREE statement, 403PROC DTREE statement, see DTREE procedure
general options, 401–404graphics options, 405–411line-printer options, 412
QUIT keywordERRHANDLE= option (DTREE), 402
QUIT statementDTREE procedure, 414
R keywordDISPLAY= option (DTREE), 402
RC optionPROC DTREE statement, 410TREEPLOT statement (DTREE), 416
RECALL statementDTREE procedure, 414, 467, 470
RESET statementDTREE procedure, 414, 442
REWARD keywordMODIFY statement (DTREE), 413
REWARD= optionVARIABLES statement (DTREE), 417, 441
RT= optionEVALUATE statement (DTREE), 413PROC DTREE statement, 403, 450, 461RESET statement (DTREE), 442
SAVE statementDTREE procedure, 415, 467, 470
SPACE unitsYBETWEEN= option (DTREE), 404
STAGE keywordDISPLAY= option (DTREE), 402
STAGE= optionVARIABLES statement (DTREE), 417, 441
STAGEIN= optionPROC DTREE statement, 403
STATE= optionVARIABLES statement (DTREE), 419, 441
SUCC= option, see SUCCESSOR= optionSUCCESSOR= option
VARIABLES statement (DTREE), 418, 441SUMMARY option
EVALUATE statement (DTREE), 413, 470, 477PROC DTREE statement, 403, 465
SUMMARY statementDTREE procedure, 415, 441, 450, 465
SYMBC= option, see SYMBOLC= optionSYMBD= option, see SYMBOLD= optionSYMBE= option, see SYMBOLE= optionSYMBOLC= option
PROC DTREE statement, 410TREEPLOT statement (DTREE), 416, 461
SYMBOLD= optionPROC DTREE statement, 410TREEPLOT statement (DTREE), 416, 461
SYMBOLE= optionPROC DTREE statement, 411
TREEPLOT statement (DTREE), 416, 461
TARGET= optionEVALUATE statement (DTREE), 413, 470PROC DTREE statement, 403, 465SUMMARY statement (DTREE), 415, 441, 450,
465TOLERANCE= option
PROC DTREE statement, 404TREEPLOT statement
DTREE procedure, 415, 416, 457, 461, 477TYPE keyword
MODIFY statement (DTREE), 413TYPE= option
VARIABLES statement (DTREE), 418, 441
UTILITY= option, see VALUE= option
VALUE= optionVARIABLES statement (DTREE), 419
VARIABLES statementDTREE procedure, 416–419, 441
VC= option, see VSYMBOLC= optionVD= option, see VSYMBOLD= optionVE= option, see VSYMBOLE= optionVPC statement
DTREE procedure, 419, 469VPI statement
DTREE procedure, 420, 468VSYMBOLC= option
PROC DTREE statement, 411TREEPLOT statement (DTREE), 416
VSYMBOLD= optionPROC DTREE statement, 411TREEPLOT statement (DTREE), 416
VSYMBOLE= optionPROC DTREE statement, 411TREEPLOT statement (DTREE), 416
WARNING optionPROC DTREE statement, 404
WEB= optionVARIABLES statement (DTREE), 418, 433
YBETWEEN= optionPROC DTREE statement, 404TREEPLOT statement (DTREE), 416, 457, 477