Chapter Contents 
Previous 
Next 
The DTREE Procedure 
For example, a loan officer is faced with the problem of deciding whether to approve or deny an application for a oneyear $30,000 loan at the current rate of 15% of interest. If the application is approved, the lender will either pay off the loan in full after one year or default. Based on experience, the default rate is about 36 out 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 lender, the loan officer engages a credit investigation unit at a cost of $500 per person that will give either a positive recommendation for making a loan or a negative recommendation. Past experience with this investigator yields that of those who ultimately paid off their loans, 570 out of 664 were given a positive recommendation. On the other hand, 6 out of 26 that had defaulted had also been given a positive recommendation by the investigator.
The STAGEIN= data set, Stage6, gives the structure of the decision problem.
/*  create the STAGEIN= data set  */ data Stage6; input _STNAME_ $ 116 _STTYPE_ $ 1720 _OUTCOM_ $ 2144 _SUCC_ $ 4560; datalines; Application D Approve loan Payment . . Deny loan . Payment C Pay off . . . Default . Investigation D Order investigation Recommendation . . Do not order Application Recommendation 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 observation in this data set indicates that if the officer denies the loan application, then payoffs are the interest from the money invested in government bonds. The second and the third observations are redundant for the basic analysis 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;
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=Payoff6 summary 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 reward for this outcome using the
MODIFY statement.
The quotes that enclose the outcome name in the MODIFY
statement are necessary because the outcome name contains a space.
The results in Output 3.5.1 and Output 3.5.2 indicate that it is optimal to do the following:

save; move payment before investigation; evaluate; recall;
Notice that moving the stage `Payment
' to the beginning of the
tree means that the new
decision tree contains two scenarios that are not in the original tree:
the scenario `Pay off
' and `Deny loan
',
and the scenario `Default
' and `Deny loan
'.
The second and third observations in the
Payoff6 data set supply values for these new scenarios. If these
records are not included in the PAYOFFS=
data set, then
PROC DTREE assumes they are 0.
Also notice that the SUMMARY and TARGET= options are specified globally in the PROC DTREE statement and hence are not needed in the EVALUATE statement. The results from the DTREE procedure are displayed in Output 3.5.3.
Output 3.5.3: Summary of the Loan Grant Decision with Perfect Information

Do not order
' the investigation,
as shown in Output 3.5.1,
is $2,726. Therefore, the
maximum amount he should pay for the perfect investigation can
be determined easily as
Note that if you use the VPI statement to determine the value of a perfect investigation, the result is different from 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 value with perfect information, then to compare this value with the value with current information available (in this example, it is the recommendation from the original investigation unit). Therefore, the VPI statement returns a value that is calculated as
The loan officer considered another question regarding the maximum amount he should pay to a company to help collect the principal and the interest if an applicant defaults on the loan. This question is similar to the question concerning the improvement that can be expected if he can control whether or not an applicant will default on his loan (of course he will always want the lender to pay off in full after one year). The answer to this question can be obtained with the following statements:
modify payment type; evaluate;Output 3.5.4: Summary of the Loan Grant Decision with Perfect Control

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 of the payoffs for the various scenarios given in the Payoff6 data set is proportional to the value of loan, you can safely assume that the value of the loan is 1 unit and determine the ratio of the value for a particular service to the value of the loan. To obtain these ratios, change the value of the variable LOAN to 1 in the Payoff6 data set and invoke PROC DTREE again as follows:
/*  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 dtree stagein=Stage6 probin=Prob6 payoffs=Payoff6a nowarning; evaluate / summary target=investigation; save; move payment before investigation; evaluate; recall; modify payment type; evaluate; quit;
The optimal decision summary given in Output 3.5.5 shows that the ratio of the value of investigation that the loan officer currently engages in to the value of the loan is 0.1242  0.0909 = 0.0333 to 1.
Output 3.5.5: Summary of the Loan Grant Decision with 1 Unit Loan

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.
show that the ratio of the value of perfect investigation to the value of a loan is 0.1464  0.0909 = 0.0555 to 1, and the ratio of the maximum amount the officer should pay for perfect control to the value of loan is 0.15  0.0909 = 0.591 to 1.
Output 3.5.6, produced by the following statements, shows a table of the values of the investigation currently engaged 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); 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.12420.0909; ratio2=0.14640.0909; ratio3=0.150.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 via Value of Loan'; proc print label; format loan vci vpi vpc dollar12.0; run;Output 3.5.6: Values of Loan and Associated Values of Service

Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.