Learn R Programming

nproc (version 2.1.5)

compare: Compare two NP classification methods at different type I error upper bounds.

Description

compare compares NP classification methods and provides the regions where one method is better than the other.

Usage

compare(roc1, roc2, plot = TRUE, col1 = "black", col2 = "red")

Arguments

roc1

the first nproc object.

roc2

the second nproc object.

plot

whether to generate the two NP-ROC plots and mark the area of significant difference. Default = 'TRUE'.

col1

the color of the region where roc1 is significantly better than roc2. Default = 'black'.

col2

the color of the region where roc2 is significantly better than roc1. Default = 'red'.

Value

A list with the following items.

alpha1

the alpha values where roc1 is significantly better than roc2.

alpha2

the alpha values where roc2 is significantly better than roc1.

alpha3

the alpha values where roc1 and roc2 are not significantly different.

References

Xin Tong, Yang Feng, and Jingyi Jessica Li (2018), Neyman-Pearson (NP) classification algorithms and NP receiver operating characteristic (NP-ROC), Science Advances, 4, 2, eaao1659.

See Also

npc, nproc, predict.npc and plot.nproc

Examples

Run this code
# NOT RUN {
n = 1000
set.seed(1)
x1 = c(rnorm(n), rnorm(n) + 1)
x2 = c(rnorm(n), rnorm(n)*sqrt(6) + 1)
y = c(rep(0,n), rep(1,n))
fit1 = nproc(x1, y, method = 'lda')
fit2 = nproc(x2, y, method = 'lda')
v = compare(fit1, fit2)
legend('topleft',legend=c('x1','x2'),col=1:2,lty=c(1,1))

# }

Run the code above in your browser using DataLab