PlotEmpiricalOperatingCharacteristics.Rd
Plot empirical operating characteristics (operating points connected by straight lines) for specified modalities and readers, or, if desired, plots (no operating points) averaged over specified modalities and / or readers.
PlotEmpiricalOperatingCharacteristics(
dataset,
trts = 1,
rdrs = 1,
opChType,
legend.position = c(0.8, 0.3),
maxDiscrete = 10
)
Dataset object.
List or vector: integer indices of modalities to be plotted. Default is 1.
List or vector: integer indices of readers to be plotted. Default is 1.
Type of operating characteristic to be plotted: "ROC"
,
"FROC"
, "AFROC"
, "wAFROC"
, "AFROC1"
,
"wAFROC1"
, or "LROC"
.
Where to position the legend. The default is c(0.8, 0.2), i.e., 0.8 rightward and 0.2 upward (the plot is a unit square).
maximum number of op. points in order to be considered discrete and to be displayed by symbols and connecting lines; any more points will be regarded as continuous and only connected by lines; default is 10.
A ggplot2 object containing the operating characteristic plot(s) and a data frame containing the points defining the operating characteristics.
ggplot2 object. For continuous or averaged data, operating characteristics curves are plotted without showing operating points. For binned (individual) data, both operating points and connecting lines are shown. To avoid clutter, if there are more than 20 operating points, they are not shown.
Data frame with four columns: abscissa, ordinate,
class
(which codes modality and reader names) and type
, which
can be "D"
for discrete ratings, "C"
for continuous ratings,
i.e., more than 20 operating points, or "A"
, for reader averaged.
The trts
and rdrs
are vectors or lists of
integer indices, not the corresponding string IDs. For
example, if the string ID of the first reader is "0", the value in
rdrs
should be 1 not 0. The legend will display
the string IDs.
If both of trts
and rdrs
are vectors, all combinations of
modalities and readers are plotted. See Example 1.
If both trts
and rdrs
are lists
, they must have the
same length. Only the combination of modality and reader at the same
position in their respective lists are plotted. If some elements of the
modalities and / or readers lists are vectors, the average operating
characteristic over the implied modalities and / or readers are plotted.
See Example 2.
For LROC
datasets, opChType
can be "ROC" or "LROC".
## Example 1
## Plot individual empirical ROC plots for all combinations of modalities
## 1 and 2 and readers 1, 2 and 3. Six operating characteristics are plotted.
ret <- PlotEmpiricalOperatingCharacteristics(dataset =
dataset02, trts = c(1:2), rdrs = c(1:3), opChType = "ROC")
## print(ret$Plot)
## Example 2
## Empirical wAFROC plots, consisting of
## three sub-plots:
## (1) sub-plot, red, with operating points, for the 1st modality (string ID "1") and the 2nd
## reader (string ID "3"), labeled "M:1 R:3"
## (2) sub-plot, green, no operating points, for the 2nd modality (string ID "2") AVERAGED
## over the 2nd and 3rd readers (string IDs "3" and "4"), labeled "M:2 R: 3 4"
## (3) sub-plot, blue, no operating points, AVERAGED over the first two modalities
## (string IDs "1" and "2") AND over the 1st, 2nd and 3rd readers
## (string IDs "1", "3" and "4"), labeled "M: 1 2 R: 1 3 4"
plotT <- list(1, 2, c(1:2))
plotR <- list(2, c(2:3), c(1:3))
ret <- PlotEmpiricalOperatingCharacteristics(dataset = dataset04, trts = plotT,
rdrs = plotR, opChType = "wAFROC")
## print(ret$Plot)
## Example 3
## Correspondences between indices and string identifiers for modalities and
## readers in this dataset (apparently reader "2" did not complete the study).
## names(dataset04$descriptions$readerID)
## [1] "1" "3" "4" "5"