Learn R Programming

a4 (version 1.20.0)

ROCcurve: Receiver operating curve

Description

A ROC curve plots the fraction of true positives (TPR = true positive rate) versus the fraction of false positives (FPR = false positive rate) for a binary classifier when the discrimination threshold is varied. Equivalently, one can also plot sensitivity versus (1 - specificity).

Usage

ROCcurve(object, groups, probesetId = NULL, geneSymbol = NULL, main = NULL, probe2gene = TRUE, ...)

Arguments

object
ExpressionSet object for the experiment
groups
String containing the name of the grouping variable. This should be a the name of a column in the pData of the expressionSet object.
probesetId
The probeset ID. These should be stored in the featureNames of the expressionSet object.
geneSymbol
The gene symbol. These should be stored in the column `Gene Symbol` in the featureData of the expressionSet object.
main
Main title on top of the graph
probe2gene
Boolean indicating whether the probeset should be translated to a gene symbol (used for the default title of the plot)
...
Possibility to add extra plot options. See par

References

Some explanation about ROC can be found on http://en.wikipedia.org/wiki/ROC_curve and http://www.anaesthetist.com/mnm/stats/roc/Findex.htm. The latter has at the bottom a nice interactive tool to scroll the cut-off and to see how it affects the FP/TP table and the ROC curve.

Examples

Run this code
# simulated data set
esSim <- simulateData()
ROCcurve(probesetId = 'Gene.1', object = esSim, groups = 'type', addLegend = FALSE)

# ALL data set
if (require(ALL)){
  data(ALL, package = "ALL")
  ALL <- addGeneInfo(ALL)
  ALL$BTtype <- as.factor(substr(ALL$BT,0,1))
  ROCres <- ROCcurve(gene = "ABL1", object = ALL, groups = "BTtype")
}

Run the code above in your browser using DataLab