"which"
) from the
results of a call to roc
, including the ROC curve
itself.## S3 method for class 'roc':
plot(x,
which = c(1:3,5),
prior = NULL,
show.stats = TRUE,
abline.col = "grey",
inGroup.col = "red",
outGroup.col = "blue",
caption = c("ROC curve", "Dissimilarity profiles",
"TPF - FPF vs Dissimilarity",
"Likelihood ratios", "Pr (A+ | d)"),
legend = "topright",
ask = prod(par("mfcol")) < length(which) && dev.interactive(),
...)
"roc"
."roc"
object to
plot if a subset of the plots is required, specify a subset of the
numbers 1:5
.c(0.5, 0.5)
)
specifiying the prior probabilities of analogue and
no-analogue. Used to generate posterior probability of analogue
using Bayes factors in plot 5 (which = 5
).legend
for keywords that can be
specified.TRUE
, the user is asked before
each plot, see par(ask=.)
.plot.lm
and many of the conventions and defaults for that function are
replicated here. First, some definitions:
[object Object],[object Object],[object Object],[object Object],[object Object]
The "ROC curve" plot (which = 1
,) draws the ROC curve itself as
a plot of the False Positive Fraction against the True Positive
Fraction. A diagonal 1:1 line represents no ability for the
dissimilarity coefficient to differentiate between groups. The AUC
statistic may also be displayed (see argument "show.stats"
above).
The "Dissimilarity profile" plot (which = 2
), draws the density
functions of the dissimilarity values (d) for the correctly
assigned samples and the incorrectly assigned samples. A dissimilarity
coefficient that is able to well distinguish the sample groupings will
have density functions for the correctly and incorrectly assigned
samples that have little overlap. Conversely, a poorly discriminating
dissimilarity coefficient will have density profiles for the two
assignments that overlap considerably. The point where the two curves
cross is the optimal dissimilarity or critical value, d'. This
represents the point where the difference between TPF and FPF is
maximal. The value of d at the point where the difference
between TPF and FPF is maximal will not neccesarily be the
same as the value of d' where the density profiles cross. This
is because the ROC curve has been estimated at discrete points
d, which may not include excatly the optimal d', but
which should be close to this value if the ROC curve is not sampled on
too coarse an interval.
The "TPF - FPF vs Dissimilarity" plot, draws the difference between the ROC curve and the 1:1 line. The point where the ROC curve is farthest from the 1:1 line is the point at which the ROC curve has maximal slope. This is the optimal value for d, as discussed above.
The "Likelihood ratios" plot, draws two definitions of the slope of the ROC curve as the likelihood functions LR(+), and LR(-). LR(+), is the likelihood ratio of a positive test result, that the value of d assigns the sample to the group it belongs to. LR(-) is the likelihood ratio of a negative test result, that the value of d assigns the sample to the wrong group.
LR(+) is defined as $LR(+) = TPF / FPF$ (or sensitivity / (1 - specificity)), and LR(-) is defined as $LR(-) = FPF / TNF$ (or (1 - sensitivity) / specificity), in Henderson (1993).
The
Henderson, A.R. (1993) Assessing test accuracy and its clinical consequences: a primer for receiver operating characteristic curve analysis. Annals of Clinical Biochemistry 30, 834--846.
roc
## continue the example from roc()
example(roc)
## draw the ROC curve
plot(swap.roc, 1)
## draw the four default diagnostic plots
opar <- par(mfrow = c(2,2))
plot(swap.roc)
par(opar)
Run the code above in your browser using DataLab