prec_auc: Sample size or precision for AUC

View source: R/diagnostic.R

prec_aucR Documentation

Sample size or precision for AUC

Description

Calculate the sample size from AUC, prevalence and confidence interval width or the expected confidence interval width from AUC, prevalence and sample size, following Hanley and McNeil (1982).

Usage

prec_auc(auc, prev, n = NULL, conf.width = NULL, conf.level = 0.95, ...)

Arguments

auc

AUC value.

prev

prevalence.

n

number of observations.

conf.width

precision (the full width of the confidence interval).

conf.level

confidence level.

...

other arguments to optimize.

Details

Sample size is derived by optimizing the difference between the difference between the lower and upper limits of the confidence interval and conf.width.

Value

Object of class "presize", a list of arguments (including the computed one) augmented with method and note elements.

References

Hanley, JA and McNeil, BJ (1982) The Meaning and Use of the Area under a Receiver Operating Characteristic (ROC) Curve. Radiology 148, 29-36

Examples

# confidence interval width
N <- 500
prev <- .1
auc <- .65
(prec <- prec_auc(auc, prev, n = N))
cwidth <- prec$conf.width
# sample size
prec_auc(auc, prev, conf.width = cwidth)

presize documentation built on March 7, 2023, 8:28 p.m.