Editverse Free Calculator
Likelihood Ratio and Fagan Nomogram Calculator
Turn sensitivity and specificity, or a 2×2 table, into LR+ and LR-, then move a pre-test probability to a post-test probability on a Fagan nomogram. Free, with 95% confidence intervals when you enter counts.
In Simple Words
A positive or negative test result does not tell you the chance of disease on its own. That chance depends on how likely the disease was before the test. A likelihood ratio (LR) says how strongly a result shifts that starting chance. An LR+ above 1 raises the probability, and an LR- below 1 lowers it.
Enter your test results and a pre-test probability. The calculator gives the post-test probability after a positive and after a negative result, and draws the Fagan nomogram so you can see the line from pre-test to post-test.
When to Use a Likelihood Ratio Calculator
Use it when you need to interpret a diagnostic test for a patient or a population whose pre-test probability differs from the study that reported the test’s accuracy. Sensitivity and specificity describe the test. They do not give the probability that a particular person is diseased. Likelihood ratios bridge that gap because they combine both measures and can be applied to any pre-test probability.
It is also useful in writing. If you are preparing a diagnostic accuracy paper, a systematic review or a clinical teaching case, you can report LR+ and LR- with confidence intervals and show how a result changes the probability across a range of prevalences. Enter a 2×2 table to get intervals, or enter sensitivity and specificity, or known LR values, for a point estimate.
tp <- {tp}; fp <- {fp}; fn <- {fn}; tn <- {tn}; pretest <- {pretest} # pre-test probability, %
if (any(c(tp, fp, fn, tn) == 0)) { tp <- tp + .5; fp <- fp + .5; fn <- fn + .5; tn <- tn + .5 } # zero-cell correction
sens <- tp/(tp+fn); spec <- tn/(tn+fp)
# From sens/spec instead: sens <- {sens}/100; spec <- {spec}/100
lrp <- sens/(1-spec); lrn <- (1-sens)/spec
# From LRs instead: lrp <- {lrp}; lrn <- {lrn}
se_p <- sqrt(1/tp - 1/(tp+fn) + 1/fp - 1/(fp+tn)); se_n <- sqrt(1/fn - 1/(tp+fn) + 1/tn - 1/(fp+tn))
ci <- function(l, se) exp(log(l) + c(-1, 1) * qnorm(0.975) * se)
odds <- (pretest/100) / (1 - pretest/100)
post <- function(l) { o <- odds * l; 100 * o / (1 + o) }
list(LRplus = c(lrp, ci(lrp, se_p)), LRminus = c(lrn, ci(lrn, se_n)),
post_positive = post(lrp), post_negative = post(lrn))User guide
When to use. Convert a test result into a post-test probability: enter sensitivity/specificity, a 2×2 table or published likelihood ratios, set the pre-test probability, and read the answer from the table or the Fagan nomogram.
Assumptions. Sensitivity and specificity are transportable to your setting; the pre-test probability is realistic (a prevalence or a clinical estimate); the result is dichotomous. With 2×2 counts the CI uses the log method (Simel 1991), which assumes adequate cell counts. If any cell is zero, 0.5 is added to every cell before computing LR and CI (continuity correction), and the page says so.
Common mistakes. Do not chain likelihood ratios of correlated tests as if independent. LR from sensitivity and specificity entered as percentages carries no CI (counts are needed). A spec of 100% gives LR+ = infinity; in counts mode the 0.5 correction gives a finite but very wide-interval value.
Worked example
Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.
References
- Fagan TJ. Nomogram for Bayes theorem. N Engl J Med. 1975;293(5):257.
- Simel DL, Samsa GP, Matchar DB. Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J Clin Epidemiol. 1991;44(8):763-770.
- Deeks JJ, Altman DG. Diagnostic tests 4: likelihood ratios. BMJ. 2004;329(7458):168-169.
Worked Example
Take a 2×2 table with 80 true positives, 20 false positives, 15 false negatives and 85 true negatives. Sensitivity is 84.21% and specificity is 80.95%. LR+ is 4.42 (95% CI 2.95 to 6.62) and LR- is 0.195 (95% CI 0.12 to 0.31).
With a pre-test probability of 20% (pre-test odds 0.25), a positive result gives a post-test probability of 52.5%, a rise of 32.5 percentage points. A negative result gives 4.65%, a fall of 15.35 points. The same test at other pre-test probabilities gives different post-test values:
- 1% pre-test: 4.27% after a positive, 0.20% after a negative.
- 5% pre-test: 18.88% after a positive, 1.02% after a negative.
- 10% pre-test: 32.94% after a positive, 2.12% after a negative.
- 50% pre-test: 81.55% after a positive, 16.32% after a negative.
A second example shows the zero-cell rule. With 25 true positives, 0 false positives, 5 false negatives and 70 true negatives, LR+ would be infinite. The calculator adds 0.5 to every cell before computing, which gives LR+ 116.81 (95% CI 7.34 to 1858.24) and LR- 0.18 (95% CI 0.08 to 0.38). At a 10% pre-test probability that is 92.85% after a positive and 1.95% after a negative. The very wide interval is the honest message: the correction is a convention, and the data cannot pin down LR+ with so few false-positive observations. Sensitivity and specificity are shown uncorrected.
Assumptions to Check
- The LRs apply to your patient. LRs are treated as constant across settings and spectrums of disease. In practice they can vary with case mix, so an LR from a specialist referral population may not transfer to primary care.
- The pre-test probability is reasonable. The post-test result is only as good as this input. The calculator does not carry uncertainty in the pre-test value through to the answer.
- Tests are independent. Chaining LRs by multiplication assumes the tests are conditionally independent given disease status. Correlated tests, such as two imaging methods looking at the same feature, overstate the combined effect.
- The reference standard is sound. Errors in the reference standard bias sensitivity, specificity and therefore both LRs.
- Intervals are approximate. The 95% interval uses the log method and is only available when you enter counts. It is approximate with small cells.
Common Mistakes
Treating LR+ as a probability
An LR+ of 4.42 does not mean a 4.42% chance. It multiplies the pre-test odds. Convert probability to odds, multiply, then convert back, or let the nomogram do it.
Multiplying a probability by the LR
The multiplication works on odds, not on probability. At a 20% pre-test probability the odds are 0.25, and multiplying by 4.42 gives odds that correspond to 52.5%, not a probability computed by scaling 20% directly.
Ignoring prevalence
The same LR+ moves a 1% pre-test probability to 4.27% and a 50% pre-test probability to 81.55%. A positive result is not equally convincing in every setting.
Reading a zero-cell result as precise
When a cell is zero, the 0.5 correction makes the LR finite but the interval is very wide. Report the interval and avoid quoting the point estimate alone.
Chaining correlated tests
Multiplying LRs from tests that share information double-counts the evidence. Check independence before combining.
Frequently Asked Questions
What is a likelihood ratio?
LR+ is sensitivity divided by (1 – specificity). LR- is (1 – sensitivity) divided by specificity. Each compares how often a result occurs in people with the disease versus without it.
How is the Fagan nomogram read?
Mark the pre-test probability on the left axis and the LR on the middle axis. A straight line through both reaches the post-test probability on the right axis. The calculator draws one line for LR+ and one for LR-.
What counts as a large LR?
The calculator’s verdict uses common thresholds. An LR+ above 10 or an LR- below 0.1 is a large shift. LR+ of 5 to 10 and LR- of 0.1 to 0.2 are moderate. LR+ of 2 to 5 and LR- of 0.2 to 0.5 are small. Values closer to 1 give minimal change.
Why does the calculator add 0.5 to the table?
If any cell is zero, LR+ or LR- is undefined or infinite. Adding 0.5 to all four cells is a standard continuity correction. It is applied only to the LRs and their interval, and it is stated in the results.
Can I enter sensitivity and specificity instead of counts?
Yes. You will get point estimates for LR+, LR- and post-test probability, but no confidence interval, because the interval needs the cell counts.
Does this replace clinical judgment?
No. It supports interpretation of a test result. The pre-test probability and the applicability of the LRs remain judgments for the clinician or researcher.
Related Calculators
ROC Curve and AUC CalculatorDiagnostic Accuracy CalculatorSensitivity, Specificity and Predictive ValuesPrevalence CalculatorConfidence Interval CalculatorOdds Ratio and Relative Risk Calculator
References
- Fagan TJ. Letter: Nomogram for Bayes’s theorem. N Engl J Med. 1975. PMID 1143310
- Deeks JJ, Altman DG. Diagnostic tests 4: likelihood ratios. BMJ. 2004. PMID 15258077
- Jaeschke R, Guyatt GH, Sackett DL. Users’ guides to the medical literature. III. How to use an article about a diagnostic test. B. What are the results and will they help me in caring for my patients? JAMA. 1994. PMID 8309035
- Simel DL, Samsa GP, Matchar DB. Likelihood ratios with confidence: sample size estimation for diagnostic test studies. J Clin Epidemiol. 1991. PMID 1941027
Need This Analysis Done for Your Manuscript?
Need help reporting likelihood ratios, intervals and post-test probabilities in a diagnostic accuracy paper? Editverse statisticians can check your analysis and write the results section.
