ROC: Plot the Receiver Operating Characteristic Curve

Description Usage Arguments Details Value Author(s) Examples

View source: R/ROC.R

Description

The function computes and plots the empirical ROC (receiver operating characteristic) curve.

Usage

1
2
3
4
5
6
7
8
9
ROC(object, ...)

## Default S3 method:
ROC(object, se.d, scale = 1, length = 1000,
fig = TRUE, se.type = c("CI", "SE"), CI.alpha = 0.05, ...)

## S3 method for class 'anota'
ROC(object, length = 1000, fig = TRUE,
se.type = c("CI", "SE"), CI.alpha = 0.05, ...) 

Arguments

object

the class of the object defines, which of the methods is invoked. If obejct is a single element numeric vector it is taken as a d-prime value and the default method is invoked. If the object is of class anota, the method for anota objects is invoked.

se.d

a unit length vector with the standard error of d-prime. If supplied confidence intervals or standard errors are plotted

scale

a unit length vector giving the ratio of scale (ie. standard deviation) of the latent distribution for the no-class items relative to that of the yes-class items

length

the length of the vectors to be plotted. Longer vectors gives more smooth curves.

fig

Should a plot be produced?

se.type

The type of band for the ROC curve, "CI" for confidence interval and "SE" for standard error.

CI.alpha

the type I level of the confidence interval of AUC

...

additional arguments to plot and lines

Details

The function currently ignores the variance of the scale in the computation of the uncertainty of the ROC curve.

Value

The function makes a plot of the ROC curve, and if se.d is supplied, standard errors or confidence intervals for the curve are added to the plot.

The function also (invisibly) returns a list with the following components

ROCx

x-coordinates to the ROC curve

ROCy

y-coordinates to the ROC curve

If se.d is supplied, the object also contains

lower

y-coordinates to the lower limit

upper

y-coordinates to the upper limit

Author(s)

Rune Haubo B Christensen

Examples

1
2
3
4
5
6
7
## ROC.default:
(mat <- matrix(c(8, 17, 1, 24), 2, byrow = TRUE))
(d.prime <- SDT(mat, "probit")[3])
ROC(d.prime)
## ROC.anota:
fm1 <- AnotA(8, 25, 1, 25)
ROC(fm1)

Example output

     [,1] [,2]
[1,]    8   17
[2,]    1   24
[1] 1.282987

sensR documentation built on May 2, 2019, 9:43 a.m.