getroc {SPARRAfairness} | R Documentation |
getroc() Comprehensive plotting function for receiver-operator characteristic curve. Also calculates AUROC and standard error.
Description
Rather than returning points corresponding to every cutoff, only returns a representative sample of equally-spaced points along the curve.
Usage
getroc(y, ypred, cv = NULL, res = 100)
Arguments
y |
class labels, 0/1 or logical |
ypred |
predictions Pr(Y=1), numeric vector |
cv |
cross-validation fold assignments, if relevant. Changes estimate of standard error. |
res |
resolution. Returns this many equally-spaced points along the curve. Set res to null to return all points. |
Details
SE of AUROC with no CV structure is from Hanley and McNeil 1982. SE of AUROC with CV folds is from LeDell et al 2012
Does not plot anything. Object can be plotted in a default way.
Value
list containing: spec, specificity for res points in every cv fold; sens, sensitivity for res points in every cv fold; auc, areas under the curve for each fold and average (note length is 1 greater than number of CV folds); se, standard error for AUC in each fold and standard error for average auc (note length is 1 greater than number of CV folds)
Examples
# See vignette