Every PCR, histology report, gill score and risk score a fish health team acts on is an imperfect test, and knowing how it is imperfect changes what a result means. Sensitivity and specificity describe the test itself, while predictive values also depend on how common the disease is where you are testing, which is why a positive from a "90% test" for a rare disease can be wrong four times out of five. This guide walks through those measures with worked salmon examples, including group-level sampling, apparent versus true prevalence and why a sensitive screen followed by a specific confirmation gives the most reliable answer.
Every result you act on in fish health is a test result: a PCR from 20 fish, a histology report, a gill score, a mortality code, a model's risk score. None of them are perfect. Good decisions start with knowing how each one is imperfect.
Epidemiologists use a small set of numbers to describe this. They're simple once you see them laid out, and they explain some things that otherwise feel paradoxical, like why a "good" test can be wrong most of the time.
Every time a test meets reality, one of four things happens:
| Disease really present | Disease really absent | |
|---|---|---|
| Test positive | True positive (TP) | False positive (FP) |
| Test negative | False negative (FN) | True negative (TN) |
Every measure below is a different way of reading this table.
Sensitivity (Se): of the fish that really have the disease, the share the test flags. A highly sensitive test rarely misses. A negative result from it is reassuring.
Se = TP / (TP + FN)
Specificity (Sp): of the fish that really don't have the disease, the share the test correctly leaves unflagged. A highly specific test rarely raises false alarms. A positive result from it carries weight.
Sp = TN / (TN + FP)
These two describe the test itself. They're measured against a reference standard. When no perfect reference exists, which is common in aquaculture, they're estimated by comparing several tests across populations with different infection levels (Bayesian latent class analysis).
Two caveats that matter in practice:
There's a third button labelled "perfect test". It isn't connected to anything.
At the cage side, you don't know whether the disease is present. That's why you tested. You know the result, and you want to know what it means.
Positive predictive value (PPV): of the fish that test positive, the share that really have the disease. "It came back positive. How likely is it real?"
PPV = TP / (TP + FP)
Negative predictive value (NPV): of the fish that test negative, the share that really are free of it. "It came back negative. Can I relax?"
NPV = TN / (TN + FN)
When colleagues ask "how accurate is it?", they usually mean PPV. Strictly speaking, accuracy is a separate number: the share of all results that are correct. For rare diseases it's misleading, because true negatives dominate it. You'll see why in the next section.
Glossary note: data-science reports often use different names for the same things. Recall is sensitivity. Precision is PPV.
Sensitivity and specificity belong to the test. Predictive values belong to the test and the population. Specifically, they depend on how common the disease is where you're testing (the prevalence, or pre-test probability).
Here's a worked example, using counts rather than percentages because they're easier to follow.
Picture 1,000 fish tested one by one. 3% really have the disease. The test has 90% sensitivity and 90% specificity.
| Diseased (30) | Healthy (970) | Total | |
|---|---|---|---|
| Test positive | 27 | 97 | 124 |
| Test negative | 3 | 873 | 876 |
PPV = 27 / 124 ≈ 22%. A positive result from this "90% test" is right only about one time in five. NPV = 873 / 876 ≈ 99.7%. A negative result is very reliable. Accuracy = (27 + 873) / 1,000 = 90%. The test is "90% accurate", and still most of its positives are wrong.
Now run the same test where the disease is more common:
| Prevalence | PPV | NPV |
|---|---|---|
| 20% | 69% | 97% |
| 5% | 32% | 99.4% |
| 3% | 22% | 99.7% |
Same test, Se 90% and Sp 90% throughout.
With real numbers. A Norwegian Veterinary Institute field study of tests for salmonid alphavirus (the cause of PD) estimated, per fish, that real-time RT-PCR has about 98% sensitivity but 83% specificity, and histopathology about 64% sensitivity and 97% specificity (Jansen et al., 2019). At 3% prevalence, a positive PCR on a single fish would be right only about 15% of the time. At 20% prevalence it would be right about 59% of the time. The PCR is an excellent screen, which is exactly why the authors recommend confirming weak positives.
Some lessons from the field:
Han Solo, on hearing that a positive from a "90% test" is 90% likely to be real.
Rather than "is the test right?", ask: "how much should this result change what I believed before?"
That's the idea behind pre-test and post-test probability:
The bridge between them is the likelihood ratio:
For our 90/90 test, LR+ = 9 and LR− ≈ 0.11. So a positive multiplies the odds of disease by 9, and a negative divides them by about 9. (Odds are not the same as probability: 3% is odds of about 1 to 32.)
Starting from 3%, a positive takes you to about 22%. That's the PPV again, reached another way. A negative takes you to about 0.3%.
Why bother with this framing? It matches how vets already reason. A test result never replaces judgement. It updates it. A result that moves a fish, a pen or a site from 3% to 22% is very useful information even though it's "wrong" four times out of five. It turns something you'd ignore into something you should look at.
So far we've treated each fish as the unit. In practice we rarely diagnose individual fish. We sample a few and draw conclusions about the pen or the site. That adds a second layer of uncertainty.
Group-level sensitivity: the chance that a sample of n fish includes at least one positive, when the group is truly infected. Assuming a large population, random sampling, and no false positives:
Group Se = 1 − (1 − p × Se)n
where p is the within-pen prevalence and Se is the per-fish sensitivity.
For a 20-fish PCR with 95% per-fish sensitivity:
| True within-pen prevalence | Chance the 20-fish sample includes a positive |
|---|---|
| 10% | ~86% |
| 5% | ~62% |
Turned around: with 20 fish and a perfect test, you can be 95% confident of picking up an infection only if at least ~14% of the pen is infected. Detecting 5% with the same confidence takes about 59 fish. This is the "freedom from disease" logic veterinary authorities use worldwide (Cannon & Roe, 1982, described in Kreienbrock & Schüpbach-Regula).
Two real-world complications:
Lesson: a negative 0/20 PCR early in an outbreak means "below what this sample can detect", not "free". That's one reason a later test at the same site can come back positive without either result being wrong.
When you count test positives, you get the apparent prevalence, which includes false positives and misses false negatives. In our 1,000-fish example, 124 of 1,000 fish tested positive: an apparent prevalence of 12.4%, against a true prevalence of 3%. That's about four times too high, from a test with 90% specificity.
If you know Se and Sp, you can correct for it. This is the Rogan–Gladen estimator:
True prevalence = (Apparent prevalence + Sp − 1) / (Se + Sp − 1)
which gives (0.124 + 0.9 − 1) / (0.9 + 0.9 − 1) = 3%.
Lesson: "X% of fish (or sites) tested positive this year" is not the same as "X% had the disease". Imperfect specificity inflates the count, especially when the disease is rare.
The World Organisation for Animal Health (WOAH) judges diagnostic tests by whether they're fit for their intended purpose. The purposes include declaring a population free of disease, certifying animals for trade, supporting eradication, confirming clinical cases, estimating prevalence, and checking immune status after vaccination. Each purpose needs a different balance of Se and Sp. For example, confirming a clinical case calls for high specificity, to avoid false positives (Kreienbrock & Schüpbach-Regula).
For a fish health team, the practical version:
| You want to… | You need… | Example |
|---|---|---|
| Not miss an emerging problem | High sensitivity; accept false alarms | Early-warning signals, routine PCR screening, surveillance |
| Confirm before costly action | High specificity | Histopathology, cell culture, a vet's diagnosis combining clinical signs and lab results |
| Do both | Tests in series: a sensitive screen first, then a specific confirmation | Signal → sample → PCR → histopathology |
Testing in series trades a little sensitivity for a lot of specificity. A case only counts if it passes both tests. Using the PD test figures above, PCR followed by histopathology gives an overall specificity of about 99.5% and sensitivity of about 63%. That lifts the PPV at 3% prevalence from about 15% to about 79%. (This assumes the two tests' errors are independent of each other, which is a simplification.)
That's how the system is meant to work. An early-warning signal tells you where to look. The confirmatory test tells you what you found. Neither replaces the other.
Sensitivity and specificity, finally on speaking terms.
| Term | Plain question | Formula | Depends on prevalence? |
|---|---|---|---|
| Sensitivity (recall) | Of the sick, how many does it catch? | TP / (TP + FN) | No* |
| Specificity | Of the healthy, how many does it clear? | TN / (TN + FP) | No* |
| PPV (precision) | It's positive. Is it real? | TP / (TP + FP) | Yes: falls as disease gets rarer |
| NPV | It's negative. Can I relax? | TN / (TN + FN) | Yes: rises as disease gets rarer |
| Accuracy | What share of all results are right? | (TP + TN) / total | Yes: inflated by true negatives when disease is rare |
| LR+ | How much does a positive raise the odds? | Se / (1 − Sp) | No* |
| Apparent prevalence | What share tested positive? | (TP + FP) / total | Yes |
| Group sensitivity | Will my sample of n catch an infected pen? | 1 − (1 − p·Se)n | Yes, on within-pen prevalence |
*For a fixed cut-off and a similar population. They can still vary with stage of infection, life stage and sampling.
Three habits to take away: