View source: R/AUC_calc_integral.R
AUC_calc_integral | R Documentation |
This function reads in a vector of sensitivity and a vector of specificity to calculates the area under the curve (AUC) by trapezoidal integration.
AUC_calc_integral(sens, spec)
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). |
It returns AUC as a numerical scalar.
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
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.