liveBook · Manning

Specificity

As explained in Fabulous Adventures in Data Structures and Algorithms

Test specificity is the conditional probability that a medical test is negative when the tested condition is absent.

Test specificity is the conditional probability that a medical test is negative when the tested condition is absent. Alongside sensitivity, it describes test accuracy without determining how likely a positive result is to be correct. section 13.4

A highly specific test can still produce mostly false positives

Suppose Frob Syndrome affects 1 person in 30,000. A cheap test has 99.5% sensitivity and 99.5% specificity. Among roughly 6 million people, about 199 sick people test positive, but about 29,999 healthy people also test positive. Thus, after a positive result, the posterior chance of having the syndrome is only 0.7%. section 13.4

static IDiscreteDistribution<CheapTest> TestResultGivenFrob(Frob f)
{
    List<CheapTest> cheap = [CheapTest.Negative, CheapTest.Positive];
    return f == Frob.No ?
        cheap.ToCategorical(995, 5) :
        cheap.ToCategorical(5, 995);
}

Represent the test-result likelihood with separate negative and positive probabilities for people with and without the condition. section 13.4

How Fabulous Adventures in Data Structures and Algorithms covers it

How deep it goes
Defines specificity, assigns it a numerical value, and contrasts its population consequences with sensitivity and prior prevalence.
Examples
Uses Frob Syndrome, a 99.5% accurate cheap test, and a joint-distribution count of true and false results.
What it assumes
Assumes conditional probability and Bayes’ theorem while grounding their use in a concrete medical-test scenario.
What you can do after
Evaluate how test specificity interacts with prevalence to interpret positive results using Bayesian calculations.
How it connects
Connects specificity to sensitivity, conditional probability, Bayes’ theorem, prior probability, likelihood, posterior probability, and joint distributions.

Also explained in

Compare how 6 books explain specificity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fabulous Adventures in Data Structures and Algorithms. The section links point to the parts of the book it draws on.