rStats.js v1.3.0
    Preparing search index...

    Function auc

    • The area under a ROC curve, or the partial area between two specificities or sensitivities. Equivalent to pROC::auc() in R.

      The partial area sums the trapezoids of the points within the limits and interpolates the curve linearly at the limits. With correct, it is standardised as McClish (1989): (1 + (A − min)/(max − min))/2, with min the area under the diagonal and max that of the perfect curve between the limits, computed exactly from the counts of the points and rounded once (a curve on the diagonal gives 0.5); below the diagonal that is undefined, an error (pROC: NA with a warning). Limits outside [0, 1] are an error (pROC: NA).

      Parameters

      Returns AucResult

      const r = roc({ controls: [1, 2, 2, 3, 5, 7], cases: [2, 4, 5, 5, 8, 9, 10] });
      auc(r).auc; // 0.7857142857142857
      auc(r, { partialAuc: [1, 0.8] }).auc; // 0.08666666666666666
      auc(r, { partialAuc: [1, 0.8], correct: true }).auc; // 0.6851851851851852