Data for generating KS chart.

blr_prep_kschart_data(gains_table)

blr_prep_kschart_line(gains_table)

blr_prep_ksannotate_y(ks_line)

blr_prep_kschart_stat(ks_line)

blr_prep_ksannotate_x(ks_line)

Arguments

gains_table

An object of clas blr_gains_table.

ks_line

Overall conversion rate.

Examples

model <- glm(honcomp ~ female + read + science, data = hsb2, family = binomial(link = 'logit')) gt <- blr_gains_table(model) blr_prep_kschart_data(gt)
#> # A tibble: 11 x 3 #> cum_total_per cum_1s_per cum_0s_per #> <dbl> <dbl> <dbl> #> 1 0 0 0 #> 2 0.1 0.264 0.0408 #> 3 0.2 0.509 0.0884 #> 4 0.3 0.698 0.156 #> 5 0.4 0.830 0.245 #> 6 0.5 0.887 0.361 #> 7 0.6 0.943 0.476 #> 8 0.7 0.962 0.605 #> 9 0.8 1 0.728 #> 10 0.9 1 0.864 #> 11 1 1 1
ks_line <- blr_prep_kschart_line(gt) blr_prep_kschart_stat(ks_line)
#> [1] 59
blr_prep_ksannotate_y(ks_line)
#> [1] 0.5375433
blr_prep_ksannotate_x(ks_line)
#> [1] 0.5