Skip to contents

Sensitivity and specificity, (positive and negative) predictive values and (positive and negative) diagnostic likelihood ratios of a single binary diagnostic test.

Usage

acc.1test(tab, alpha, testname, method.ci, ...)

Arguments

tab

An object of class tab.1test.

alpha

Significance level alpha for 100(1-alpha)%-confidence intervals, the default is 0.05.

testname

A character string containing the name of the diagnostic test.

method.ci

A character string with the name of the function to compute the confidence intervals for sensitivity, specificity, and predictive values. The default is ''waldci'' for a Wald asymptotic normal-based confidence intervals. See 'Details'.

...

Additional arguments (usually not required).

Details

The calculation of accuracy measures follows standard methodology, e.g. described in Pepe (2003) or Zhou et al. (2011).

The confidence intervals for sensitivity, specificity, and predictive values are computed using the methodology implemented in the function passed to the argument method.ci.

Available options are:

  1. waldci - Wald asymptotic normal-based confidence interval; the default,

  2. logitci - asymptotic normal-based confidence interval on the logit scale and then back-transformed,

  3. exactci - Clopper-Pearson exact confidence interval,

  4. add4cici - Agresti-Coull add-4 confidence interval,

  5. addz2ci - Agresti-Coull add-z^2/2 confidence interval,

  6. blakerci - Blaker exact confidence interval,

  7. scoreci - Wilson score confidence interval,

  8. midPci - mid-P confidence interval.

Options (3) to (8) are based on the homonymous functions from the {PropCIs} package. Please see the respective package documentation for more details.

Confidence intervals for diagnostic likelihood ratios are computed according to Simel et al. (1991).

Value

A list of class acc.1test:

tab

A contingency table (matrix) of test results; the same tab that is supplied as an argument.

DiseasedNon-diseasedTotal
Test pos..........
Test neg..........
Total.........
sensitivity

A numeric vector containing the estimated sensitivity (est), its standard error (se), lower confidence limit (lcl) and upper confidence limit (ucl).

specificity

A numeric vector containing the estimated specificity (est), its standard error (se), lower confidence limit (lcl) and upper confidence limit (ucl).

ppv

A numeric vector containing the estimated positive predictive value (est), its standard error (se), lower confidence limit (lcl) and upper confidence limit (ucl).

npv

A numeric vector containing the estimated negative predictive value (est), its standard error (se), lower confidence limit (lcl) and upper confidence limit (ucl).

pdlr

A numeric vector containing the estimated positive diagnostic likelihood ratio (est), the standard error of the logarithm of the positive diagnostic likelihood ratio (se.ln), the lower confidence limit (lcl) and the upper confidence limit (ucl).

ndlr

A numeric vector containing the estimated negative diagnostic likelihood ratio (est), the standard error of the logarithm of the negative diagnostic likelihood ratio (se.ln), the lower confidence limit (lcl) and the upper confidence limit (ucl).

alpha

The significance level alpha used to compute 100(1-alpha)%-confidence intervals, the default is 0.05.

testname

A character string containing the name of the diagnostic test.

method.ci

A character string describing the method used to compute the confidence intervals for sensitivity, specificity, and predictive values.

References

Pepe, M. (2003). The statistical evaluation of medical tests for classification and prediction. Oxford Statistical Science Series. Oxford University Press, 1st edition.

Simel, D.L., Samsa, G.P., Matchar, D.B. (1991). Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J Clin Epidemiol, 44(8):763-70.

Zhou, X., Obuchowski, N., and McClish, D. (2011). Statistical Methods in Diagnostic Medicine. Wiley Series in Probability and Statistics. John Wiley & Sons, Hoboken, New Jersey, 2nd edition.

Examples

data(Paired1) # Hypothetical study data 
a1 <- tab.1test(d=d, y=y1, data=Paired1)
a2 <- acc.1test(a1)
print(a2)
#> Diagnostic accuracy of test 'y1'
#> 
#> (Estimates, standard errors and 95%-confidence intervals)
#> 
#>                  Est.         SE  Lower CL  Upper CL
#> Sensitivity 0.8802661 0.01528718 0.8503038 0.9102284
#> Specificity 0.6781609 0.02891782 0.6214830 0.7348388
#> PPV         0.8253638 0.01731081 0.7914353 0.8592924
#> NPV         0.7662338 0.02784617 0.7116563 0.8208113
#> 
#>            Est.  SE (log)  Lower CL  Upper CL
#> PDLR  2.7351124 0.0915147 2.2860079 3.2724472
#> NDLR  0.1765568 0.1346088 0.1356142 0.2298601
a3 <- acc.1test(a1, method="exactci", alpha=0.01)
print(a3)
#> Diagnostic accuracy of test 'y1'
#> 
#> (Estimates, standard errors and 99%-confidence intervals)
#> 
#>                  Est. SE  Lower CL  Upper CL
#> Sensitivity 0.8802661 NA 0.8357035 0.9165483
#> Specificity 0.6781609 NA 0.5989643 0.7506971
#> PPV         0.8253638 NA 0.7765533 0.8675685
#> NPV         0.7662338 NA 0.6872115 0.8339622
#> 
#>            Est.  SE (log)  Lower CL  Upper CL
#> PDLR  2.7351124 0.0915147 2.1607304 3.4621812
#> NDLR  0.1765568 0.1346088 0.1248251 0.2497279