auc_density: Calculate exact AUCs based on the distribution of risk in a...

Description Usage Arguments Value Author(s) Examples

View source: R/auc_density.R

Description

Provided a distribution of risk in a population, this function calculates the exact AUC of a model that produces the risk estimates. For example, a logistic regression model built with a normal linear predictor yields logit-normal distributed predicted risks. The AUC from the logistic regression model is the same as the AUC estimated from the distribution of the predicted risks, independent of the outcome. This method for AUC calculation is useful for simulation studies where the predicted risks are a mixture of two distributions. The exact prevalence of the outcome can easily be calculated, along with the exact AUC of the model.

Usage

1
auc_density(density, cut.points = seq(from = 0, to = 1, by = 0.001), ...)

Arguments

density

a function name that describes the continuous probability density function of the risk from 0 to 1.

cut.points

sequence of points in [0, 1] where the sensitivity and specificity are calculated. More points lead to a more precise estimate of the AUC. Default is seq(from = 0, to = 1,by = 0.001).

...

arguments for the function specified in density. For example, dbeta(x, shape1=1, shape2=1) has need for two additional arguments to specify the density function (shape1 and shape2).

Value

Returns a list sensitivity and specificity at each cut point, the expected value or mean risk, and the AUC associated with the distribution.

Author(s)

Daniel D Sjoberg sjobergd@mskcc.org

Examples

1
auc_density(density = dbeta, shape1 = 1, shape2 = 1)

ddsjoberg/hotfun documentation built on Dec. 12, 2021, 3:41 a.m.