ASSESS Procedure

Example 3.1 Assess a Model That Has a Binary Target

(View the complete code for this example.)

The following example demonstrates how to use the ASSESS procedure to compute ROC information, lift information, and fit statistics for a model that has a nominal target.

The following DATA step creates a score data table from a previously trained model. For example, the model could be a tree-based model, a neural network, or a support vector machine.

data mylib.score2;
   length good_bad $4;
   input _PartInd_ good_bad p_good p_bad;
   datalines;
0 good 0.6675 0.3325
0 good 0.5189 0.4811
0 good 0.6852 0.3148
0 bad  0.0615 0.9385
0 bad  0.3053 0.6947
0 bad  0.6684 0.3316
0 good 0.6422 0.3578
0 good 0.6752 0.3248
0 good 0.5396 0.4604
0 good 0.4983 0.5017
0 bad  0.1916 0.8084
0 good 0.5722 0.4278
0 good 0.7099 0.2901
0 good 0.4642 0.5358
0 good 0.4863 0.5137
1 bad  0.4942 0.5058
1 bad  0.4863 0.5137
1 bad  0.4942 0.5058
1 good 0.6118 0.3882
1 good 0.5375 0.4625
1 good 0.8132 0.1868
1 good 0.6914 0.3086
1 good 0.5700 0.4300
1 good 0.8189 0.1811
1 good 0.2614 0.7386
1 good 0.1910 0.8090
1 good 0.5129 0.4871
1 good 0.8417 0.1583
1 good 0.5500 0.4500
;

The following PROC ASSESS call uses five bins to do lift analysis and uses 0.2 as the incremental step size for ROC analysis:

proc assess data=mylib.score2 ncuts=5 nbins=5;
   var p_good;
   target good_bad / event="good" level=nominal;
   fitstat pvar=p_bad / pevent="bad" ;
   by _PartInd_;
run;

Output 3.1.1 shows the lift and gain for each bin in the first partition.

Output 3.1.1: Lift Regression Information for the First Partition

The ASSESS Procedure

Lift Information
VariableEventDepthNumber of
Observations
Number of
Events
Captured Response
Percent
LiftResponse PercentGain
IndividualCumulativeIndividualCumulativeCumulative BestIndividualCumulativeIndividualBest
p_goodgood0000.000.00.......
  203327.2727.271.3636361.3636361.363636100.00100.000.3636360.363636
  403218.1845.450.9090911.1363641.36363666.6783.330.1363640.363636
  603327.2772.731.3636361.2121211.363636100.0088.890.2121210.363636
  803327.27100.001.3636361.2500001.250000100.0091.670.2500000.250000
  100300.00100.000110.0073.3300


Output 3.1.2 shows the ROC information, including the confusion matrix and its derivations, for each bin in the first partition.

Output 3.1.2: ROC Information for the First Partition

ROC Information
VariableEventCutoffTPFPFNTNFPRFDRTPRFNRTNRACCKSYouden
Index
F1 ScoreF0.5 ScoreAUCGiniGammaTauMisclassification
(Event)
p_goodgood01140010.2666671000.733333000.8461540.7746480.8068180.6136360.6923080.2571430.266667
  0.200000112020.5000000.153846100.5000000.86666700.5000000.9166670.8730160.8068180.6136360.6923080.2571430.133333
  0.400000111030.2500000.083333100.7500000.93333310.7500000.9565220.9322030.8068180.6136360.6923080.2571430.066667
  0.60000051630.2500000.1666670.4545450.5454550.7500000.53333300.2045450.5882350.7142860.8068180.6136360.6923080.2571430.466667
  0.800000001140.0110.26666700000.8068180.6136360.6923080.2571430.733333
  1001140.0110.26666700000.8068180.6136360.6923080.2571430.733333


Output 3.1.3 shows the error metrics of the nominal target in the first partition.

Output 3.1.3: Fit Statistics for the First Partition

Fit Statistics
Number of
Observations
Squared ErrorMean
Consequential Error
Multiclass
Log Loss
Divisor of AverageAverageRoot Average
15150.1691270.4112500.2666670.514728


Output 3.1.4 shows the lift and gain for each bin in the second partition.

Output 3.1.4: Lift Regression Information for the Second Partition

The ASSESS Procedure

Lift Information
VariableEventDepthNumber of
Observations
Number of
Events
Captured Response
Percent
LiftResponse PercentGain
IndividualCumulativeIndividualCumulativeCumulative BestIndividualCumulativeIndividualBest
p_goodgood0000.000.00.......
  203327.2727.271.3636361.3636361.363636100.00100.000.3636360.363636
  403327.2754.551.3636361.3636361.363636100.00100.000.3636360.363636
  603327.2781.821.3636361.3636361.363636100.00100.000.3636360.363636
  80300.0081.8201.0227271.2500000.0075.000.0227270.250000
  1002218.18100.000.90909111100.0078.5700


Output 3.1.5 shows the ROC information, including the confusion matrix and its derivations, for each bin in the second partition.

Output 3.1.5: ROC Information for the Second Partition

ROC Information
VariableEventCutoffTPFPFNTNFPRFDRTPRFNRTNRACCKSYouden
Index
F1 ScoreF0.5 ScoreAUCGiniGammaTauMisclassification
(Event)
p_goodgood01130010.2142861000.785714000.8800000.8208960.6363640.2727270.4285710.0989010.214286
  0.2000001031010.2307690.9090910.09090900.7142860-0.090910.8333330.7936510.6363640.2727270.4285710.0989010.285714
  0.400000932010.2500000.8181820.18181800.6428570-0.181820.7826090.7627120.6363640.2727270.4285710.0989010.357143
  0.6000005063000.4545450.54545510.57142910.4545450.6250000.8064520.6363640.2727270.4285710.0989010.428571
  0.8000003083000.2727270.72727310.42857100.2727270.4285710.6521740.6363640.2727270.4285710.0989010.571429
  1001130.0110.21428600000.6363640.2727270.4285710.0989010.785714


Output 3.1.6 shows the error metrics of the nominal target in the second partition.

Output 3.1.6: Fit Statistics for the Second Partition

Fit Statistics
Number of
Observations
Squared ErrorMean
Consequential Error
Multiclass
Log Loss
Divisor of AverageAverageRoot Average
14140.2215870.4707310.1428570.636734


Last updated: May 14, 2026