1
|
|
# pROC: Tools Receiver operating characteristic (ROC curves) with
|
2
|
|
# (partial) area under the curve, confidence intervals and comparison.
|
3
|
|
# Copyright (C) 2014 Xavier Robin
|
4
|
|
#
|
5
|
|
# This program is free software: you can redistribute it and/or modify
|
6
|
|
# it under the terms of the GNU General Public License as published by
|
7
|
|
# the Free Software Foundation, either version 3 of the License, or
|
8
|
|
# (at your option) any later version.
|
9
|
|
#
|
10
|
|
# This program is distributed in the hope that it will be useful,
|
11
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
|
# GNU General Public License for more details.
|
14
|
|
#
|
15
|
|
# You should have received a copy of the GNU General Public License
|
16
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
|
|
18
|
|
Ops.auc <- function(e1, e2) {
|
19
|
3
|
if (methods::is(e1, "auc"))
|
20
|
3
|
attributes(e1) <- NULL
|
21
|
3
|
if (methods::is(e2, "auc"))
|
22
|
3
|
attributes(e2) <- NULL
|
23
|
3
|
NextMethod()
|
24
|
|
}
|
25
|
|
|
26
|
|
Math.auc <- function(x, ...) {
|
27
|
3
|
attributes(x) <- NULL
|
28
|
3
|
NextMethod()
|
29
|
|
}
|
30
|
|
|
31
|
|
Ops.ci.se <- Ops.ci.sp <- Ops.ci.auc <- function(e1, e2) {
|
32
|
3
|
e1 <- remove.ci.attributes(e1)
|
33
|
3
|
e2 <- remove.ci.attributes(e2)
|
34
|
3
|
NextMethod()
|
35
|
|
}
|
36
|
|
|
37
|
|
|
38
|
|
Math.ci.se <- Math.ci.sp <- Math.ci.auc <- function(x, ...) {
|
39
|
3
|
x <- remove.ci.attributes(x)
|
40
|
3
|
NextMethod()
|
41
|
|
}
|
42
|
|
|
43
|
|
remove.ci.attributes <- function(ci) {
|
44
|
3
|
attr(ci, "conf.level") <- NULL
|
45
|
3
|
attr(ci, "boot.n") <- NULL
|
46
|
3
|
attr(ci, "boot.stratified") <- NULL
|
47
|
3
|
attr(ci, "specificities") <- NULL
|
48
|
3
|
attr(ci, "sensitivities") <- NULL
|
49
|
3
|
attr(ci, "roc") <- NULL
|
50
|
3
|
attr(ci, "method") <- NULL
|
51
|
3
|
attr(ci, "auc") <- NULL
|
52
|
3
|
class(ci) <- class(ci)[-(1:2)]
|
53
|
3
|
return(ci)
|
54
|
|
}
|