plotAUC: Plot AUC and ROC Curve with Confidence Intervals

View source: R/global.visu.R

plotAUCR Documentation

Plot AUC and ROC Curve with Confidence Intervals

Description

This function generates a Receiver Operating Characteristic (ROC) curve and computes the Area Under the Curve (AUC) along with the corresponding confidence intervals. It also highlights the best threshold using Youden's index.

Usage

plotAUC(score, y, main = "", ci = TRUE, percent = TRUE)

Arguments

score

A numeric vector containing the predicted scores from the model.

y

A numeric or factor vector containing the true class labels. The labels should be binary, with two levels (e.g., 1 and -1, or 0 and 1).

main

A string representing the title of the plot. Default is an empty string.

ci

A logical value indicating whether to compute and display the confidence intervals for the AUC. Default is 'TRUE'.

percent

A logical value indicating whether to express the ROC curve in percentage scale. Default is 'TRUE'.

Details

The function uses the 'pROC' package to compute and plot the ROC curve and AUC. The best threshold is determined using Youden’s index, and it is displayed on the plot with vertical and horizontal lines. The plot includes the AUC value and its confidence intervals, as well as the best threshold on the curve.

Value

A 'roc' object from the 'pROC' package, containing the ROC curve and AUC information.

Author(s)

Edi Prifti (IRD)

Examples

## Not run: 
# Assuming `score` is a vector of predicted scores and `y` is the true labels
plotAUC(score, y, main = "ROC Curve with AUC", ci = TRUE)

## End(Not run)


predomics/predomicspkg documentation built on Dec. 11, 2024, 11:06 a.m.