Learn R Programming

blorr (version 0.3.0)

blr_gains_table: Gains table & lift chart

Description

Compute sensitivity, specificity, accuracy and KS statistics to generate the lift chart and the KS chart.

Usage

blr_gains_table(model, data = NULL)

# S3 method for blr_gains_table plot( x, title = "Lift Chart", xaxis_title = "% Population", yaxis_title = "% Cumulative 1s", diag_line_col = "red", lift_curve_col = "blue", plot_title_justify = 0.5, print_plot = TRUE, ... )

Arguments

model

An object of class glm.

data

A tibble or a data.frame.

x

An object of class blr_gains_table.

title

Plot title.

xaxis_title

X axis title.

yaxis_title

Y axis title.

diag_line_col

Diagonal line color.

lift_curve_col

Color of the lift curve.

plot_title_justify

Horizontal justification on the plot title.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

...

Other inputs.

Value

A tibble.

References

Agresti, A. (2007), An Introduction to Categorical Data Analysis, Second Edition, New York: John Wiley & Sons.

Agresti, A. (2013), Categorical Data Analysis, Third Edition, New York: John Wiley & Sons.

Thomas LC (2009): Consumer Credit Models: Pricing, Profit, and Portfolio. Oxford, Oxford Uni-versity Press.

Sobehart J, Keenan S, Stein R (2000): Benchmarking Quantitative Default Risk Models: A Validation Methodology, Moody<U+2019>s Investors Service.

See Also

Other model validation techniques: blr_confusion_matrix(), blr_decile_capture_rate(), blr_decile_lift_chart(), blr_gini_index(), blr_ks_chart(), blr_lorenz_curve(), blr_roc_curve(), blr_test_hosmer_lemeshow()

Examples

Run this code
# NOT RUN {
model <- glm(honcomp ~ female + read + science, data = hsb2,
             family = binomial(link = 'logit'))
# gains table
blr_gains_table(model)

# lift chart
k <- blr_gains_table(model)
plot(k)

# }

Run the code above in your browser using DataLab