zepid.calc.utils.specificity

zepid.calc.utils.specificity(detected, noncases, alpha=0.05, confint='wald')

Calculate the specificity from number of false detections and the number of total non-cases.

Parameters:
  • detected (integer, float) – Number of false cases detected via testing criteria
  • noncases (integer, float) – Total number of non-cases
  • alpha (float, optional) – Alpha value to calculate two-sided Wald confidence intervals. Default is 95% confidence interval
  • confint (string, optional) – Type of confidence interval to generate. Current options include Wald or Hypergeometric confidence intervals
Returns:

Tuple of specificity, lower CL, upper CL, SE

Return type:

tuple

Examples

Calculating specificity

>>> from zepid.calc import specificity
>>> sp = specificity(88, 100)

Extract specificity

>>> sp[0]

Extract confidence intervals for specificity

>>> sp[1:3]

Extract standard error

>>> sp[3]