2×2 Test Accuracy
This tool describes how a test performed across a set of samples. Do not use it to decide anything about an individual patient.
The 2×2 table
Fill all four cells to get results. The margins fill themselves in.
| Test result against condition | Condition present | Condition absent | Total |
|---|---|---|---|
| Test positive | True positive (a) | False positive (c) | — |
| Test negative | False negative (b) | True negative (d) | — |
| Total | — | — | — |
Left empty, it is read off the table. Fill it in when the samples were not collected in the proportion the population has.
How this is worked out
The figures themselves are all standard arithmetic. What differs between rows is how the confidence interval is arrived at, and the Method column says which one applied to which row rather than leaving you to look it up.
A row with an empty interval is not a fault. One of three words appears there — “no denominator” means the quantity is not defined because there was nothing to divide by, “supplied value” means the prevalence was typed in and so carries no sampling error, and “not estimable” means the figure sits at 0 or at infinity, where the log and logit scales have no room.
A cell holds up to 10,000,000. That is a limit of the routine this tool uses rather than of the exact method itself — on tables far larger than the cap its interval was found to drift without complaining, so a larger table is refused rather than answered wrongly. Within the allowed range the values were checked against an independent calculation.
- Sensitivity, specificity, prevalence and accuracy — the exact (Clopper-Pearson) interval. All four are proportions counted straight off the table, which is the situation the exact method is for.
- Positive and negative predictive value — the logit method. Its variance carries no prevalence term, which is what lets a supplied prevalence produce an interval at all. When the value reaches exactly 0% or 100% the logit becomes infinite and the exact interval on the same count takes over.
- Positive and negative likelihood ratio — the log scale, using the same two variances as the predictive values.
- With a supplied prevalence, accuracy becomes a weighted average of sensitivity and specificity. It is no longer a count out of a total, so the exact method has nothing to work on and no interval is shown.
Common questions
References
Where the reference values and the confidence-interval methods come from. Sensitivity, specificity and the other measures are proportions counted straight from the table and are not cited.
- MedCalc Software Ltd. Diagnostic test evaluation calculator (MedCalc Statistical Software). Output obtained by the requester for the same 2×2 table, captured 2026-07-30.https://www.medcalc.org/calc/diagnostic_test.phpThe reference values — eight measures and their 95 % confidence intervals for one 2×2 table (93, 0, 2, 645), to two decimals. The 1.96 interval coefficient was fixed as the value that reproduces this output
- Clopper CJ, Pearson ES. (1934) The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 26(4):404–413.doi:10.1093/biomet/26.4.404The exact confidence interval used for sensitivity, specificity, prevalence and accuracy
The logit and log intervals for the predictive values and likelihood ratios are the standard delta-method intervals and are not separately cited.
Often used together
ROC curve & AUC
Draws the ROC curve, reports the AUC, and lists the performance at every cutoff.
Sample Size Calculator
Works out how many specimens a sensitivity or specificity target needs.
Bland-Altman plotter
Analyses the agreement and the regression between two measurement methods.