Learn R Programming

RJafroc (version 0.1.1)

EmpiricalOpCharac: Plot empirical operating characteristic

Description

Plot emprirical operating characteristics (operating points connected by straight lines) for specified trts and rdrs in the dataset.

Usage

EmpiricalOpCharac(dataset, trts, rdrs, lgdPos, opChType = "ROC")

Arguments

dataset
Dataset to be used for plotting.
trts
List or vector: indices of modalities to be plotted. See "Details".
rdrs
List or vector. indices of readers to be plotted. See "Details".
lgdPos
The positioning of the legend: "right"(the default), "left", "top" or "bottom".
opChType
Type of operating characteristic to be plotted. Available choices are "ROC"(the default), "AFROC" and "FROC".

Value

A ggplot2 object of the plotted operating characteristics and a data frame containing the points of the operating characteristics are returned. Following are the returned objects of "ROC" operating characteristics.
ROCPlot
ggplot2 object: Use print function to display the saved object.
ROCPoints
Data frame with four columns: abscissa, ordinate, class (coding modality and reader) and type, which can be "individual" or "averaged".

Details

Note that trts and rdrs are the vectors or list of indices not IDs. For example, if the ID of the first reader is "0". The corresponding value in trts should be 1 not 0.

If both of trts and rdrs are vectors, all possible combinations will be plotted.

If both of trts and rdrs are lists, they must have same length. Only the combination of modality and reader at same position will be plotted. If some elements of the lists are vectors, the averaged operating characteristic over them will be plotted. See "Examples".

Examples

Run this code
plotM <- c(1:2)
plotR <- c(1:3)
EmpiricalOpCharac(dataset = rocData, trts = plotM, rdrs = plotR,
                  lgdPos = "bottom", opChType = "ROC")
## Above is the example of plotting individual ROC operating characteristics of modalities
## 1 and 2 and readers 1 to 3. Six operating characteristics will be plotted, which are
## operating characteristics of reader 1 modality 1, reader 1 modality 2, reader 2 modality
## 1, reader 2 modality 2, reader 3 modality 1 and reader 3 modality 2.

plotM <- list(1, 2, c(1:2))
plotR <- list(2, c(2:3), c(1:3))
EmpiricalOpCharac(dataset = rocData, trts = plotM, rdrs = plotR,
                  lgdPos = "bottom", opChType = "ROC")
EmpiricalOpCharac(dataset = frocData, trts = plotM, rdrs = plotR,
                  lgdPos = "bottom", opChType = "AFROC")
EmpiricalOpCharac(dataset = frocData, trts = plotM, rdrs = plotR,
                  lgdPos = "bottom", opChType = "FROC")
## Above is the example of plotting three ROC, AFROC and FROC operating characteristics.
## They are the individual operating characteristic of modality 1 reader 2, the
## averaged operating characteristic of modality 2 and reader 2 and 3 and the averaged
## operating characteristic of modality 1 and 2 and reader 1 to 3.

Run the code above in your browser using DataLab