RocPlots: Takes a list of objects returned by the ROCR function...

Description Usage Arguments Author(s) Examples

View source: R/RocPlots.R

Description

Given a list of predictive scores, and a list of corresponding true outcomes, this function calculates various predictive performance measures. Note that this function can be used in the context of multiple imputation (if the argument n.mi.chains is used), in which case the performance measures are calculated within each chain then averaged.

Usage

1
2
3
4
RocPlots(rocr.list, main.title = NULL, fpr.stop = 1, tpr.stop = 1,
  lwd = 1, roc.cols = NULL, include.legend = TRUE,
  include.percentage.diffs = FALSE, avg.type = "threshold",
  legend.name.map = NULL, legend.cex = 1.2, legend.text.width = 0.2)

Arguments

rocr.list

A named list of objects created using the ROCR function PredictivePerformance, or by using the Pmisc function FormatRocrObjects

fpr.stop

An optional maximum false positive rate (x-axis) to calculate truncated ROC curves

lwd

Line width of ROC curves (default 1)

roc.cols

Optional named vector of colours to use for the different ROC curves

legend.name.map

A character vector of different names to display for the analyses in the legend. The elements are named with the current analysis names.

legend.cex

cex argument to pass to legend - controls overall size.

legend.text.width

text.width argument to pass to legend - controls width in terms of x scale.

main

Main plot title (default NULL)

Author(s)

Paul Newcombe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
require(ROCR)
require(Pmisc)

n.vars <- 10
n.folds <- 10

# Example predictions and outcomes (in matrix format)
predictions.list <- list()
predictions.list[[1]] <- matrix(rnorm(100,0,1),n.vars,n.folds)
predictions.list[[2]] <- matrix(rnorm(100,0,1),n.vars,n.folds)
true.outcomes <- matrix(rbinom(n=100,size=1,prob=0.5),n.vars,n.folds)

# Use function to construct ROCR objects for plotting
rocs <- FormatRocrObjects(predictions.list, true.outcomes)

# Plot
RocPlots(rocs)

pjnewcombe/Pmisc documentation built on March 26, 2020, 2:09 p.m.