AUC_calc_integral: Calculate the area under a ROC curve (AUC) by trapezoidal...

View source: R/AUC_calc_integral.R

AUC_calc_integralR Documentation

Calculate the area under a ROC curve (AUC) by trapezoidal integration

Description

This function reads in a vector of sensitivity and a vector of specificity to calculates the area under the curve (AUC) by trapezoidal integration.

Usage

AUC_calc_integral(sens, spec)

Arguments

sens

a numerical vector of sensitivity values within the range of (0, 1).

spec

a numerical vector of specificity values within the range of (0, 1).

Value

It returns AUC as a numerical scalar.

Note

This function sorts sens and 1-spec in an increasing order. A 0 and 1 will be added to the two ends of the sorted vectors. The Area Under the Curve (AUC) is obtained by trapezoidal integration of the area under the piecewise linear curve obtained by connecting points in sens and 1-spec.


tdROC documentation built on May 29, 2024, 3:47 a.m.