plotKS: KS Plot & Statistic

Description Usage Arguments Value Examples

Description

Plot the cumulative distributions of each class by a score variable and calculate the KS statistic denoting the max vertical distance between the two cumulative distributions.

Usage

1
plotKS(a, b, la = "Distribution A", lb = "Distribution B")

Arguments

a

(numeric) vector of scores for the first class

b

(numeric) vector of scores for the second class

la

(character) legend label for the first class

lb

(character) legend label for the second class

Value

a list containing the following elements:

Examples

1
2
3
4
5
6
7
8
a <- rnorm(5000, 0, 2)
b <- rnorm(5000, 1, 3)
res <- plotKS(a, b, la = 'Non-Defaults', lb = 'Defaults')
res$ks.stat
res$ks.plot

# compare with internal stats function
ks.test(a, b)

etlundquist/eRic documentation built on May 16, 2019, 9:07 a.m.