compare: Compare two NP classification methods at different type I... In nproc: Neyman-Pearson (NP) Classification Algorithms and NP Receiver Operating Characteristic (NP-ROC) Curves

Description

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

Usage

 `1` ```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.

`npc`, `nproc`, `predict.npc` and `plot.nproc`
 ```1 2 3 4 5 6 7 8 9``` ```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)) ```