Density plots for the 2 groups will be created in the lower panel of
the plot (colored red (group 1) and blue (group 2)) along with rug
plots of the actual datapoints. There is also a
green vertical line that represents a decision rule cutoff, any points
higher than the cutoff are predicted to be in group 2 and points less
than the cuttoff are predicted to be in group 1. The sensitivity and
specificity for the current cuttoff value are printed below the plot.
A Tk slider box is also created that allows you to move the cuttoff
value and update the plots. As the cutoff value changes, the
different combinations of sensitivity and specificity are added to the
ROC curve in the top panel (the point corresponding to the current
cuttoff value is highlighted in red). A line is also drawn from the
point representing sensitivity and specificity both equal to 1 to the
point closest to it.