R/auc.R

Defines functions auc.roc auc

Documented in auc

#' @title Area under the curve
#' @description Calculate the area under the curve.
#'
#' `r lifecycle::badge("stable")`
#' @param x object of class \code{roc}.
#' @param ... other arguments (none are used at the moment).
#'
#' @return returns the area under the curve for a \code{roc} class object.
#' @examples
#' a <- roc(QIDS$QIDS, QIDS$depression, c("Yes","No"), "Yes")
#' auc(a)
#' @author Mathijs Deen
#' @export
auc <- function(x, ...){
  UseMethod("auc")
}

#' @export
auc.roc <- function(x, ...){
  return(x$auc)
}

Try the MDMA package in your browser

Any scripts or data that you put into this service are public.

MDMA documentation built on April 3, 2025, 11:10 p.m.