Medical Statistics Calculator

Compute diagnostic accuracy metrics from a 2x2 contingency table. Get sensitivity, specificity, PPV, NPV, odds ratio, relative risk, NNT, and likelihood ratios with confidence intervals.

Please verify you are human to use the calculator.

How Medical Statistics Work

Diagnostic Accuracy

Sensitivity and specificity measure a test's intrinsic accuracy. Sensitivity captures how well the test detects disease, while specificity measures how well it rules it out. Together they define the test's discriminative ability.

Predictive Values

PPV and NPV tell you what a test result means for the individual patient. Unlike sensitivity and specificity, they depend on disease prevalence — a positive result is far less meaningful when the condition is rare.

Effect Size Measures

Odds ratios and relative risk quantify the strength of association between exposure and outcome. Their 95% confidence intervals indicate statistical significance — if the interval crosses 1, the effect may be due to chance.

Clinical Decision Making

NNT translates statistical results into clinical action — how many patients you need to treat for one to benefit. Likelihood ratios help shift pre-test to post-test probability, guiding diagnostic reasoning at the bedside.

From Contingency Tables to Clinical Decisions

The 2×2 contingency table is the foundation of diagnostic test evaluation. From just four numbers — true positives, false positives, false negatives, and true negatives — you can derive the full suite of metrics that clinicians and researchers use to assess test performance and treatment efficacy.

Sensitivity (TP / (TP + FN)) and specificity (TN / (TN + FP)) are properties of the test itself and remain stable across populations with different disease prevalence. In contrast, PPV and NPV depend heavily on prevalence — the same test performs very differently in a high-risk referral clinic versus routine screening.

These statistical concepts connect directly to Bayesian reasoning in clinical contexts. Bayesian survival analysis with PyMC shows how prior clinical knowledge can be incorporated into time-to-event models, while Cox proportional hazards modelling demonstrates how hazard ratios — closely related to relative risk — are estimated from censored data in practice.

The odds ratio is the standard effect measure in case-control studies and logistic regression, while relative risk is preferred in cohort studies and randomised trials for its direct interpretability. The number needed to treat converts these abstract ratios into the most clinically actionable metric: how many patients must receive a treatment for one additional patient to benefit.

Related Tools

Stay in the loop

Get notified when new tutorials and deep-dives are published. No spam, unsubscribe anytime.

Medical Statistics FAQ

Common questions about diagnostic test metrics and clinical statistics