Description Usage Arguments Value See Also Examples
Takes a vector of actual responses and a vector of predictions and constructs a gains table to evaluate the predictions.
1 2 3 4 |
actual |
a numeric vector of actual response values |
predicted |
a numeric vector of predicted response values. This vector must have the same length as |
groups |
an integer containing the number of rows in the gains table. The default value is 10. |
ties.method |
method of breaking ties. See the |
conf |
method to construct confidence intervals for the mean response in each row of the table. If "none", then no confidence intervals are constructed. If "normal", then critical values from the normal distribution are used. If "t", then critical values from the t distribution are used. If "boot", then 1000 bootstrap samples are drawn from each row, and the upper and lower |
boot.reps |
the number of bootstrap replications to use for bootstrap confidence intervals. The default value is 1000. |
conf.level |
the 1 - alpha level of the confidence interval. The default value is 0.95. |
optimal |
a logical indicated whether the user wants optimal lift indices to be computed. Optimal lift indices represent the results that would be achieved from an optimal ranking of subjects. |
percents |
a logical that indicates whether to print the mean responses and predicted responses in percent form. |
gains
returns an S3 object of class gains
. The function print.gains
can be used to print the results. The function plot.gains
can be used to plot the mean response and cumulative mean response for each group.
An object of class gains
is a list containing the following components:
depth |
cumulative percentage of file covered by each row of the gains table (e.g. 10,20,30,...,100). |
obs |
number of observations in each row. |
cume.obs |
cumulative number of observations in each row. |
mean.resp |
mean response in each row. |
cume.mean.resp |
cumulative mean response in each row. |
cume.pct.of.total |
cumulative percent of total response. |
lift |
lift index. The lift index is 100 times the |
cume.lift |
cumulative lift index. It is 100 times the |
mean.prediction |
mean predicted response in each row. |
min.prediction |
minimum predicted response in each row. |
max.prediction |
maximum predicted response in each row. |
conf |
the argument given for |
optimal |
the argument given for |
num.groups |
the number of rows in the gains table. This will equal |
percents |
the argument given for |
conf.lower |
lower confidence limit for each row. Only included if confidence intervals are requested in the gains table. |
conf.upper |
upper confidence limit for each row. Only included if confidence intervals are requested in the gains table. |
opt.lift |
optimal lift index. The lift index achieved by an optimal ranking of subjects in the file. Only included if optimal lift is requested in the gains table. |
opt.cume.lift |
optimal cumulative lift index. The cumulative lift by an optimal ranking. Only included if optimal lift is requested in the gains table. |
print.gains
for printing the table in a nice way.
plot.gains
for drawing a graph representing the output. (This graph is sometimes called a lift chart.)
1 2 3 |
Depth Cume Cume Pct Optimal Optimal Mean
of Cume Mean Mean of Total Lift Cume Lift Cume Model
File N N Resp Resp Resp Index Lift Index Lift Score
-----------------------------------------------------------------------------------------
10 9 9 1.25 1.25 16.4% 168 168 209 209 1.47
20 9 18 1.25 1.25 32.7% 167 167 167 188 1.30
29 9 27 1.13 1.21 47.5% 151 162 148 175 1.17
39 9 36 0.99 1.15 60.4% 132 154 129 163 1.04
50 10 46 0.79 1.07 71.8% 105 144 109 151 0.85
60 9 55 0.56 0.99 79.2% 76 133 92 142 0.75
70 9 64 0.65 0.94 87.7% 87 126 71 132 0.65
79 9 73 0.44 0.88 93.4% 58 118 47 121 0.54
89 9 82 0.20 0.81 96.0% 27 108 29 111 0.40
100 10 92 0.27 0.75 100.0% 37 100 8 100 -0.02
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.