Learn R Programming

sensR (version 1.5-2)

ROC: Plot the Receiver Operating Characteristic Curve

Description

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

Usage

ROC(object, ...)

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

# S3 method for 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

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

Details

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

Examples

Run this code
# NOT RUN {
## 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)
# }

Run the code above in your browser using DataLab