![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Contents: | Purpose / History / Requirements / Usage / Details / Limitations / Missing Values |
All plots can be displayed in a single panel or plots can be individually presented.
%GainLift(version, <other macro options>)
The GainLift macro always attempts to check for a later version of itself. If it is unable to do this (such as if there is no active internet connection available), the macro will issue the following message:
GainLift: Unable to check for newer version
The computations performed by the macro are not affected by the appearance of this message.
Version
|
Update Notes
|
1.1 | Corrected gain formula to use absolute value. Removed cumulative gain. Added Best possible values for each statistic. Added default table of statistics. Added GRAPHOPTS= option that subsumes previous GRAPH, GRID= and PANEL= options and adds capability for displaying baseline and best possible lines. Added TABLEOPTS option that controls whether statistics table is presented and presence of baseline and best possible columns. Replaced ONEPLOT= option with PLOTS= option to specify any subset of the plots for display. Now displays notes in the log for time used and output data set creation. |
1.0 | Initial version |
%inc "<location of your file containing the GainLift macro>";
Following this statement, you can call the GainLift macro using the following syntax. Macro arguments can be listed in any order.
%GainLift(<list of macro arguments separated by commas>)
See the Results tab for an example.
The following macro arguments are required:
The following macro arguments are optional:
The gains plot shows the percent difference between the overall proportion of events and the observed proportion of events in all groups up to the current group. The lift plot gives, for each group, the ratio of the proportion of observations in the group that are events to the overall proportion of events. The cumulative lift plot gives event rate up to the current group over the overall event rate. The percent captured plot gives, for each group, the percentage of total events in the group. The cumulative percent captured plots gives the percentage of total events up to the current group. The percent response plot gives the percentage of observations in the group that are events. The cumulative percent response plot gives the percentage of observations up to the current group that are events.
The statistics are computed as follows:
E = total number of events N = number of observations G = number of groups (10 for deciles or 20 for demi-deciles) P = overall proportion of observations that are events (P = E/N) ei = number of events in group i, i=1,2,...,G bi = best event count achievable in group i, i=1,2,...,G = E-Σjej if E-Σjej≤ni, = ni otherwise, where j=1,2,...,i-1 ni = number of observations in group i pi = proportion of observations in group i that are events (pi = ei/ni) %Response = 100*pi Cumulative %Response = 100*Σiei/Σini %Captured = 100*ei/E Cumulative %Captured = 100*Σiei/E Lift = pi/P Cumulative Lift = (Σiei/Σini)/P Gain = 100*abs(Cumulative Lift-1)
The best possible statistic values for a model are computed as above using the best event count achievable, bi, rather than ei. This puts all observed events in the top decile or demi-decile groups, filling the top groups as needed to absorb all observed events.
Assuming an uninformative model which randomly puts observations into groups, baseline values for each statistic can be computed as follows:
%Response = 100*P Cumulative %Response = 100*P %Captured = 100*ni/N Cumulative %Captured = 100*Σini/N Lift = 1 Cumulative Lift = 1 Gain = 0
If the data were collected by sampling from the response levels, such as to oversample the event or in case-control settings, then see this note on adjusting the predicted probabilities for the sampling before using the macro.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.