Signature
PPV = Se * p / (Se * p + (1 - Sp) * (1 - p)); NPV = Sp * (1 - p) / (Sp * (1 - p) + (1 - Se) * p)
| Inputs | Definition | Unit |
|---|---|---|
Se | Sensitivity of the test, assumed to hold in the target population | proportion |
p | Pre-test probability of the condition in the people tested | probability |
Sp | Specificity of the test, assumed to hold in the target population | proportion |
PPV | Probability that a person with a positive result has the target condition, in the population with prevalence p | probability |
|---|---|---|
NPV | Probability that a person with a negative result does not have the target condition, in the population with prevalence p | probability |
Function
Diagnostic test accuracy measures and the expected value of test results
Maps the cross-classification of index test results against a reference standard to the measures of accuracy, conditional on disease status (sensitivity, specificity) or on the test result (predictive values), and combines accuracy with prevalence and the consequences of true and false results into the expected net monetary benefit of testing. The notation follows the Diagnostic Accuracy article and its two triage tests.
Try this function
Implementations
Excel
Predictive values at a stated prevalence from named cells
With Sens, Spec and Prev named, the formulas return the positive and negative predictive values, held in PPVPrev and NPVPrev.
=Sens*Prev/(Sens*Prev+(1-Spec)*(1-Prev)); =Spec*(1-Prev)/(Spec*(1-Prev)+(1-Sens)*Prev)
Assumptions
Sensitivity and specificity transfer to the target population
The formulas move only prevalence; if the case mix or position in the pathway differs, sensitivity and specificity may change too and need their own estimates.
Prevalence of the people actually tested
p is the pre-test probability in the population tested, not the share of cases in an enriched or case-control validation sample.
Worked examples
Triage test A at 5 per cent prevalence by Bayes' theorem
0.96 times 0.05 is 0.048 against 0.24 times 0.95, or 0.228, so PPV is about 0.1739 and NPV about 0.9972, matching the counts in HE-FM-DXA-001.
Se = 0.96; Sp = 0.76; p = 0.05; PPV = 0.1739; NPV = 0.9972
Triage tests A and B at 2 per cent prevalence
At 2 per cent prevalence test A's PPV falls to about 0.0755 (NPV 0.9989), while test B's is about 0.2899 (NPV 0.9958) (computed here for illustration).
Se = 0.96; Sp = 0.76; p = 0.02; PPV = 0.0755; NPV = 0.9989
Claims algorithm validated at 90 per cent sensitivity and 95 per cent specificity
Applied where the true prevalence is 2 per cent, the algorithm's PPV is 0.018 over 0.067, about 0.2687, as on the Criterion Validity page; in that page's validation sample, with 20 per cent cases, it is about 0.8182.
Se = 0.9; Sp = 0.95; p = 0.02; PPV = 0.2687; NPV = 0.9979
Common errors
Carrying a predictive value from an enriched validation sample
An algorithm with sensitivity 0.90 and specificity 0.95 has a PPV of about 0.82 in the Criterion Validity page's validation sample, where 20 per cent are cases, but about 0.27 at 2 per cent prevalence, so most flagged people in routine data would not have the condition.
Reading a high negative predictive value as evidence of a good test
At 2 per cent prevalence even a test with sensitivity and specificity of 0.5 has an NPV of 0.98, because almost everyone tested is free of the condition (computed here for illustration).
Sources
Likelihood ratios update the pre-test probability by Bayes' theorem
Macaskill P, Gatsonis C, Deeks JJ, Harbord RM, Takwoingi Y. Chapter 10: Analysing and presenting results. In: Deeks JJ, Bossuyt PM, Gatsonis C, editors. Cochrane Handbook for Systematic Reviews of Diagnostic Test Accuracy. Version 1.0. The Cochrane Collaboration; 2010. Section 10.2.3.3: likelihood ratios can be used to update the pre-test probability of disease using Bayes' theorem once the test result is known, giving the post-test probability; for an informative test it is higher than the pre-test probability after a positive result and lower after a negative one. Section 10.4.2: predictive values depend on prevalence.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0