Biology, Genetics & Clinical Lab Epidemiology & Diagnostic Test Statistics Bayes' theorem; STARD 2015 reporting guideline

PPV & NPV Calculator (Positive and Negative Predictive Value)

Positive predictive value answers the only question a patient actually asks: my test came back positive — what is the chance I really have this? That number is not a property of the test. It depends on how common the condition is in the group being tested, and it collapses towards zero as prevalence falls, no matter how good the assay is. Enter either a 2×2 table of counts or a sensitivity, a specificity and a prevalence, and this calculator returns PPV, NPV, the false discovery and false omission rates, and how the answer would change across the whole prevalence range.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Input styleUse counts when you have a validation study in hand; use the Bayes form when you are planning a screening programme.Sensitivity, specificity and prevalence
SensitivityProportion of people with the condition whom the test calls positive.95 %
SpecificityProportion of people without the condition whom the test calls negative.90 %
Prevalence (pre-test probability)How common the condition is in the population you are testing, not in the population at large.5 %
True positivesTest positive and confirmed to have the condition by the reference standard.90
False positivesTest positive but the reference standard says the condition is absent.10
False negativesTest negative but the condition is actually present.20
True negativesTest negative and confirmed free of the condition.880

It returns

  • Positive predictive value — Chance that a person with a positive result truly has the condition.
  • Negative predictive value
  • False discovery rate (1 − PPV)
  • False omission rate (1 − NPV)
  • Positive results per 1,000 tested
  • False positives per 1,000 tested
  • Cases missed per 1,000 tested
  • Overall accuracy

The formula

PPV=SepSep+(1Sp)(1p)
NPV=Sp(1p)(1Se)p+Sp(1p)

In plain text: PPV = (Se · p) / (Se · p + (1 − Sp) · (1 − p))

  • SeSensitivity, as a proportion (0–1)
  • SpSpecificity, as a proportion (0–1)
  • pPrevalence, or pre-test probability of disease (0–1)
  • PPVProbability of disease given a positive result (0–1)
  • NPVProbability of no disease given a negative result (0–1)

From counts the same quantities are simply PPV = TP/(TP+FP) and NPV = TN/(TN+FN); the Bayes form is what you use when you have no table for the population you care about.

Updated Category Epidemiology & Diagnostic Test Statistics Verified against published test cases Reading time 10 min

Predictive value is about the patient, not the test

Sensitivity and specificity read down the columns of a 2×2 table: given that this person has the disease, how does the test behave? Predictive values read across the rows: given that the test came back this way, what is going on with this person? That reversal is the whole content of Bayes' theorem, and it is why the two pairs of numbers behave so differently.

Sensitivity and specificity are close to fixed properties of an assay and its cut-off. Predictive values are not properties of the assay at all. Run exactly the same test on a symptomatic clinic population and on an asymptomatic screening population and the sensitivity will be roughly the same in both, while the positive predictive value can differ by a factor of fifty. Nothing about the test changed; only the mix of people did.

The practical consequence is that a PPV quoted without a prevalence is meaningless. When a manufacturer's insert reports a predictive value, look for the population it was measured in — and if you intend to use the test on a different population, recompute it. That is what the Bayes form of this calculator is for. Sensitivity and specificity come from the validation study; the prevalence comes from your own setting.

Reading the formula as a count of people

The algebra is easier to trust if you translate it back into people. Imagine testing 1,000 individuals.

Of those 1,000, p × 1,000 have the condition. The test finds Se of them, so the number of true positives is 1,000 × Se × p. The other 1,000 × (1 − p) are healthy, and the test wrongly flags (1 − Sp) of those, giving 1,000 × (1 − Sp) × (1 − p) false positives. Positive predictive value is simply the first count divided by the sum of the two — which is exactly the formula above with the 1,000s cancelled.

Written that way, the fragility of PPV is obvious. The true-positive count is proportional to prevalence; the false-positive count is proportional to one minus prevalence. When prevalence is 0.1%, the well group is 999 times larger than the diseased group, so even a 1% false-positive rate generates ten times more false alarms than the entire disease group contains people. Sensitivity barely matters at that point; specificity is everything.

Negative predictive value works the same way in reverse, and it is the mirror image: rare conditions give superb NPV almost automatically, because most people genuinely do not have the disease. An NPV of 99.9% in a screening setting is not evidence that the test is good. Check the sensitivity and specificity instead, because those are the numbers that would still be poor if the test were poor.

Worked example: a 99%/99% test for a condition affecting 1 in 1,000

Take a test with 99% sensitivity and 99% specificity — better than most assays in routine use — and apply it to a population where 0.1% of people have the condition. Work with 100,000 people so every number stays an integer.

  1. Split the population. 0.1% of 100,000 = 100 people have the condition; 99,900 do not.
  2. True positives. 99% of 100 = 99.
  3. False negatives. The remaining 1 case is missed.
  4. False positives. 1% of 99,900 = 999.
  5. True negatives. 99,900 − 999 = 98,901.
  6. PPV. 99 ÷ (99 + 999) = 99 ÷ 1,098 = 9.02%.
  7. NPV. 98,901 ÷ (98,901 + 1) = 99.999%.

So a positive result on a 99%-accurate test leaves roughly a nine in ten chance that the person is fine. Ten times as many healthy people are flagged as sick people found, purely because there are 999 times more healthy people to misclassify. Overall accuracy is 99% — (99 + 98,901) ÷ 100,000 — which is exactly why overall accuracy is a useless summary for rare conditions: a test that simply reported “negative” for everyone would score 99.9%.

This is not an argument against screening. It is an argument for a two-stage protocol: a sensitive first test to rule out, then a specific confirmatory test applied only to the 1,098 people who screened positive, where the prevalence is now 9% rather than 0.1% and the second test's PPV is far higher.

What counts as an acceptable predictive value

There is no universal threshold, because the cost of a false positive varies enormously. A false positive on a screening mammogram means a callback and an ultrasound; a false positive on a test that triggers chemotherapy is a catastrophe. Judge PPV against what happens next, not against a number.

Three rules of thumb are worth holding on to. First, a PPV below 50% means most of your positives are wrong, which is tolerable only when a confirmatory test follows and the screening test is cheap. Second, NPV close to 100% is uninformative when prevalence is low — always read it next to the false omission rate expressed as cases missed per 1,000, which this calculator reports directly. Third, a change in the population changes both numbers even though the test has not changed, so predictive values from a hospital cohort should never be quoted for community use.

If you want a measure that is prevalence-independent but still tells you how much a result should move your belief, use likelihood ratios. LR+ and LR− combine sensitivity and specificity into two numbers you can apply to any pre-test probability; the diagnostic likelihood ratio calculator does that conversion and produces the same post-test probability this page reports as PPV.

PPV and NPV of a 90%/95% test at four prevalences

Per 100,000 people tested with a test of 90% sensitivity and 95% specificity. Every cell is an exact count; PPV = TP ÷ (TP + FP) and NPV = TN ÷ (TN + FN).
PrevalenceTrue positivesFalse positivesFalse negativesTrue negativesPPVNPV
0.1%904,9951094,9051.77%99.99%
1%9004,95010094,05015.38%99.89%
5%4,5004,75050090,25048.65%99.45%
20%18,0004,0002,00076,00081.82%97.44%
50%45,0002,5005,00047,50094.74%90.48%

The test is identical in every row. PPV rises from 1.77% to 94.74% and NPV falls from 99.99% to 90.48% purely because the population changed.

Pitfalls and assumptions

  • Quoting a manufacturer's PPV in a different setting. The number was measured at their prevalence, not yours. Recompute it from sensitivity, specificity and your own prevalence.
  • Reporting accuracy for a rare condition. A test that always says “negative” scores 99.9% accuracy at a prevalence of 0.1%. Accuracy is a weighted average dominated by whichever group is larger.
  • Assuming an imperfect reference standard. If the gold standard itself misclassifies people, every count in the table is contaminated and both predictive values are biased.
  • Using population prevalence when the patient is symptomatic. Pre-test probability for a person presenting with symptoms is far above the population rate; use the clinical estimate.
  • Forgetting spectrum bias. Sensitivity measured on hospitalised, advanced cases is higher than sensitivity in early disease, so predictive values computed from it are optimistic.
  • Ignoring indeterminate results. Real assays produce equivocal readings that a 2×2 table has no cell for; dropping them inflates every performance measure.
  • Reading NPV without the miss count. An NPV of 99.9% still leaves one case missed per thousand tested, which matters if the condition is fatal and treatable.

Confidence intervals, reporting standards and related measures

This page reports point estimates. When your predictive values come from a validation study you should also report intervals, and the right method for a proportion is the Wilson score interval rather than the textbook normal approximation, which misbehaves badly near 0 and 1. Feed TP and TP+FP into the confidence interval for a proportion calculator to get a PPV interval, and TN and TN+FN for NPV. Note that an interval computed this way is valid only for the population your study sampled — it carries no uncertainty about the prevalence in a population you have not sampled.

The STARD 2015 statement is the reporting checklist that journals apply to diagnostic accuracy studies, and it asks explicitly for the 2×2 table, the reference standard, how participants were recruited, and estimates of accuracy with their precision. If you are writing up an assay validation, work through it before you write the methods section.

For a measure of association between exposure and outcome rather than test performance, use the odds ratio calculator or the relative risk calculator. For the yield of a treatment decision that follows a diagnosis, the number needed to treat calculator turns event rates into a count of patients. And when you need the underlying prevalence itself for a defined population and period, the incidence rate and prevalence calculator handles the person-time arithmetic.

Key terms

Positive predictive value
Probability that the condition is present given a positive test. TP ÷ (TP + FP).
Negative predictive value
Probability that the condition is absent given a negative test. TN ÷ (TN + FN).
False discovery rate
1 − PPV. The share of positive results that are wrong.
False omission rate
1 − NPV. The share of negative results that are wrong.
Pre-test probability
Your estimate of the chance of disease before the result arrives. In screening it is the prevalence; in a clinic it is a clinical judgement.
Spectrum bias
Distortion of accuracy estimates caused by measuring a test on a case mix that is more advanced, or a control mix that is healthier, than real practice.

Frequently asked questions

Why does PPV change when the test has not changed?

Because PPV is a statement about the population, not the assay. The false-positive count scales with the number of healthy people tested, and the true-positive count scales with the number of affected people. Shift the ratio between those two groups and the balance of positives shifts with it. Sensitivity and specificity stay put because each is computed within one disease group.

Which should I enter: population prevalence or my patient's pre-test probability?

Whatever best describes the chance of disease before the test in the situation you are analysing. For a screening programme that is the population prevalence. For a specific patient it is your clinical estimate, which for someone with classic symptoms may be 40% or 60% rather than the 1% population figure. The mathematics is identical; only the interpretation of p differs.

What is a good positive predictive value?

It depends entirely on what a positive result triggers. Screening programmes routinely operate at PPVs between about 5% and 30% because a positive leads only to a confirmatory test. A result that leads directly to surgery or cytotoxic therapy needs a PPV in the high nineties, which usually means a confirmatory test rather than a better screening test. Judge the number against the consequence, not against a benchmark.

Can I calculate PPV from sensitivity and specificity alone?

No. Two of the three inputs are not enough — you need the prevalence as well, and there is no default value that is safe to assume. This is the single most common error in reporting diagnostic tests: quoting a predictive value as though it were an intrinsic property. If someone gives you a PPV without a prevalence, ask which population it was measured in.

Why is my NPV 99.9% when the test is mediocre?

Because the condition is rare. When 999 of every 1,000 people are genuinely free of the disease, almost every negative result is correct no matter how the test behaves. Read the cases-missed-per-1,000 figure instead: it converts the false omission rate into people, which is the form in which the number is actionable.

How do I get a confidence interval for PPV?

Treat TP ÷ (TP + FP) as a binomial proportion with denominator TP + FP and compute a Wilson score interval. With 90 true positives out of 100 positives that gives roughly 82.6% to 94.5%. The interval covers sampling error in your validation study only; it does not cover uncertainty about the prevalence in a population you did not sample, which in screening is usually the larger source of error.

Does a two-stage testing protocol really help?

Yes, and the worked example shows why. Screening at 0.1% prevalence gives 99 true positives and 999 false positives. Those 1,098 people now form a group with roughly 9% prevalence — ninety times the original rate. A second, more specific test applied only to them starts from a far higher pre-test probability, so its PPV is much higher. The cost is the confirmatory testing and the anxiety of the 999.

What is the difference between PPV and post-test probability?

They are the same quantity under two names. PPV is the term used when the pre-test probability is a population prevalence; post-test probability is the term used when it is an individual clinical estimate. Both are the probability of disease after a positive result, and both come out of Bayes' theorem in exactly the same way.

References