confIntPairedDiagnostic: Confidence intervals for the comparison of two diagnostic...

View source: R/confIntDiagnostic.R

confIntPairedDiagnosticR Documentation

Confidence intervals for the comparison of two diagnostic tests from paired data

Description

Compute confidence intervals for relative sensitivity, relative specificity and relative likelihood ratios.

Usage

confIntPairedDiagnostic(
  diseased,
  nonDiseased,
  names = c(1, 2),
  conf.level = 0.95,
  adjust = FALSE
)

Arguments

diseased

2 by 2 frequency table with results from both tests in the diseased population. First row and first column refers to negative test results.

nonDiseased

2 by 2 frequency table with results from both tests in the non-diseased population. First row and first column refers to negative test results.

names

Vector of length 2. Names of first and second diagnostic tests. First name refers to the test in the columns; second name refers to the test in the rows. Default to c(1, 2).

conf.level

Confidence level for confidence interval. Default is 0.95.

adjust

Logical of length one indicating whether to compute adjusted CIs or not. Default is FALSE.

Value

A data.frame containing the estimated sensitivity, specificity, LR+ and LR- in the two tests, as well as the ratio (first versus second test or equivalently column test versus row test) with the corresponding confidence interval.

Author(s)

Leonhard Held

References

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

Examples


## Calculate confidence intervals for data from a study performing the
## the determination of chest pain
## history (CPH) and the
## Exercise stress test (EST) for patients with suspected or probably coronary
## heart disease (CHD).

diseased <- matrix(c(25, 183, 29, 786), ncol = 2, nrow = 2, byrow = TRUE)
nonDiseased <- matrix(c(151, 176, 46, 69), ncol = 2, nrow = 2, byrow = TRUE)
colnames(diseased) <- colnames(nonDiseased) <- c("CPH=0", "CPH=1")
rownames(diseased) <- rownames(nonDiseased) <- c("EST=0", "EST=1")

confIntPairedDiagnostic(diseased = diseased, nonDiseased = nonDiseased,
names = c("CPH", "EST"))


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