fitRoc: Calculates the Receiver Operating Characteristic (ROC)

Description Usage Arguments Value Author(s) Examples

Description

Calculates the Receiver Operating Characteristic (ROC).

Usage

1
2
3
## Default S3 method:
fitRoc(truth, data, recall=NULL, idxs=NULL, ncuts=1200, hasNAs=TRUE, isOrdered=FALSE,
  as=c("list", "RocCurve"), ..., verbose=FALSE)

Arguments

truth

A numeric vector of length N.

data

A numeric vector of length N.

recall

(Optional) Unless truth is given as binary \{0,1\} values, it can be reclassified as such.

idxs
ncuts
hasNAs

If TRUE (FALSE), ROC is calculated as if there are (no) missing values. [Not used!]

isOrdered

If FALSE, data is ordered, otherwise not.

...

Not used.

verbose

See Verbose.

Value

Returns a list with elements:

roc

A Kx2 double matrix where each row contains an estimate of (FP,TP) rates at a given cut.

cuts

A double vector of length K of the correspond cuts used.

Author(s)

Henrik Bengtsson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
n <- 1000
x <- rnorm(n=n, mean=0, sd=1)
y1 <- rnorm(n=n, mean=2, sd=1)
y2 <- rnorm(n=n, mean=3, sd=1)

T <- integer(2*n)
T[1:n] <- 1L

D1 <- c(x,y1)
D2 <- c(x,y2)

fit1 <- fitRoc(T,D1)
plot(fit1$roc, type="l", lwd=2, xlim=c(0,1), ylim=c(0,1))

fit2 <- fitRoc(T,D2)
lines(fit2$roc, type="l", lwd=2, col="red")

HenrikBengtsson/aroma.cn.eval documentation built on Dec. 9, 2019, 12:16 p.m.