confidence: Confidence

View source: R/confidence.R

confidenceR Documentation

Confidence

Description

Calculate a confidence interval for a proportion, such as PPA or NPA. Uses the recommended method as described in Altman chapter 6 (loc 1179 in the Kindle edition) and in CLSI EP12-A2 (2008). Note that the CLSI method may round the z-score for a 95% CI to 1.96, leading to slight differences in computed values. Here, the z-score is calculated using the stats::qnorm() function.

Usage

confidence(true_calls, false_calls, interval = 0.95)

Arguments

true_calls

The number of correct calls (true positives or true negatives).

false_calls

The number of incorrect calls (false positives or false negatives).

interval

The confidence interval to calculate. Defaults to 0.95 for 95%.

Details

Also known as "Wilson's method".

Value

A list including a lower_bound and an upper_bound.

Examples

confidence(100, 0, 0.95)
confidence(100, 0)
confidence(100, 0, 0.99)
confidence(99, 1)

bjoleary/dxr documentation built on Dec. 5, 2023, 8:33 p.m.