confIntDiagnostic: Confidence intervals for operating characteristics of a...

View source: R/confIntDiagnostic.R

confIntDiagnosticR Documentation

Confidence intervals for operating characteristics of a diagnostic test

Description

Compute confidence intervals for sensitivity, specificity, positive and negative likelihood ratio and diagnostic odds ratio of a diagnostic test. Optionally also positive and negative predictive value.

Usage

confIntDiagnostic(
  tp,
  fp,
  tn,
  fn,
  conf.level = 0.95,
  cohort = FALSE,
  pr = NA,
  digits = NA
)

Arguments

tp

Number of true positives.

fp

Number of false negatives.

tn

Number of true negatives.

fn

Number of false negatives.

conf.level

Confidence level for confidence interval. Default is 0.95.

cohort

Logical of length one indicating whether the data come from a cohort study. Default is FALSE.

pr

Prevalence.

digits

Number of digits.

Value

A dataframe containing the estimated confidence intervals for sensitivity, specificity, positive and negative likelihood ratio. Optionally also positive and negative predictive value.

Author(s)

Leonhard Held

References

Pepe, M.S. (2003) The statistical evaluation of medical tests for classification and prediction. Oxford: Oxford University Press.

Examples


## Calculate confidence intervals for data from the Million Women Study

confIntDiagnostic(tp = 629, fp = 3885, tn = 117744, fn = 97)
confIntDiagnostic(tp = 629, fp = 3885, tn = 117744, fn = 97, cohort = TRUE)
confIntDiagnostic(tp = 629, fp = 3885, tn = 117744, fn = 97, pr = 0.045)
confIntDiagnostic(tp = 629, fp = 3885, tn = 117744, fn = 97, digits = 2)  


felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.