Calculate positive and negative likelihood ratios (LR+ and LR−) from sensitivity and specificity or a 2×2 table, plus the post-test probability.
- All Statistics Calculators
- Sensitivity Analysis Calculator
- Limit of Detection Calculator
- R0 Calculator
- Positivity Rate Calculator
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Sensitivity/specificity → likelihood ratios | Finds the positive and negative likelihood ratios of a test | Requires the test’s sensitivity and specificity |
| Likelihood ratios → sensitivity/specificity | Finds the sensitivity and specificity behind a pair of likelihood ratios | Requires LR+ and LR−, one above 1 and the other below 1 |
| Diagnostic 2 × 2 table | Finds both likelihood ratios, sensitivity, specificity, predictive values, prevalence and accuracy from study counts | Requires the counts of true positives, false positives, false negatives and true negatives |
| Post-test probability from likelihood ratios | Finds the probability of the condition after a positive and after a negative test | Requires the pre-test probability, LR+ and LR− |
| Post-test probability from sensitivity/specificity | Finds the same two post-test probabilities straight from the test’s accuracy | Requires the pre-test probability, sensitivity and specificity |
Sensitivity, specificity and pre-test probability are entered as a percentage or as a decimal from 0 to 1. Table counts are whole numbers. A result that cannot be worked out from the entries, such as 0 ÷ 0, is shown as Undefined, and a ratio with a zero denominator is shown as ∞.
Likelihood Ratio Formulas
| LR+ | Positive likelihood ratio |
| LR− | Negative likelihood ratio |
| Se | Sensitivity, the share of people with the condition who test positive, as a decimal |
| Sp | Specificity, the share of people without the condition who test negative, as a decimal |
A likelihood ratio is the probability of a test result in people who have the condition divided by the probability of the same result in people who do not [1]. A ratio above 1 points toward the condition and a ratio below 1 points away from it. Ratios above 10 or below 0.1 are considered strong evidence to rule a diagnosis in or out in most circumstances [1].
Positive likelihood ratio formula
LR+ is the sensitivity divided by 1 minus the specificity [1]. With percentages it is Se% ÷ (100 − Sp%). For a sensitivity of 28.4% and a specificity of 98.6%, LR+ = 28.4 ÷ 1.4 = 20.3.
Negative likelihood ratio formula
LR− is 1 minus the sensitivity, divided by the specificity [1]. With percentages it is (100 − Se%) ÷ Sp%. For the same test, LR− = 71.6 ÷ 98.6 = 0.73.
Sensitivity/specificity → likelihood ratios
Both main formulas are applied to the entered sensitivity and specificity. The example above returns LR+ = 20.286 and LR− = 0.726. A specificity of 100% makes LR+ infinite, because no one without the condition tests positive.
Likelihood ratios → sensitivity/specificity
(LR+ − LR−)
Se = LR+ × (1 − LR−) ÷
(LR+ − LR−)
These come from solving the two main formulas together. For LR+ = 6 and LR− = 0.25, Sp = 5 ÷ 5.75 = 87.0% and Se = 6 × 0.75 ÷ 5.75 = 78.3%. The two ratios must sit on opposite sides of 1. A pair that are both 1 fits any test with Se + Sp = 1, so it has no single answer.
Diagnostic 2 × 2 table
Sp = TN ÷ (TN + FP)
TP, FP, FN and TN are the counts of true positives, false positives, false negatives and true negatives. Sensitivity and specificity are worked out first and then put through the main formulas. In a study of smoking history as a test for obstructive airway disease, 42 of 148 people with the disease and 2 of 144 without it had smoked 40 or more pack years [1]. Entering TP = 42, FP = 2, FN = 106 and TN = 142 gives Se = 28.4%, Sp = 98.6%, LR+ = 20.4 and LR− = 0.73.
The same counts give the positive predictive value TP ÷ (TP + FP) = 95.5%, the negative predictive value TN ÷ (TN + FN) = 57.3%, the sample prevalence (TP + FN) ÷ total = 50.7% and the accuracy (TP + TN) ÷ total = 63.0%. Predictive values depend on how common the condition is in the study sample and can rarely be carried over to other groups [1].
Post-test probability from likelihood ratios
p is the pre-test probability as a decimal. LR+ gives the probability after a positive test and LR− the probability after a negative one. With p = 10%, the pre-test odds are 0.1 ÷ 0.9 = 0.111. For LR+ = 20.43 the post-test odds are 2.27 and the probability is 2.27 ÷ 3.27 = 69.4%, the 0.69 of the published example [1]. For LR− = 0.73 the odds are 0.081 and the probability after a negative test is 7.5%.
Post-test probability from sensitivity/specificity
The likelihood ratios are worked out from the sensitivity and specificity, then used in the odds formulas above. A pre-test probability of 10% with Se = 28.4% and Sp = 98.6% gives 69.3% after a positive test and 7.5% after a negative test.
Limits of This Estimate
- This is an educational calculation, not a diagnosis. The sensitivity, specificity and pre-test probability must suit the patient group in question.
- Results are point estimates with no confidence interval. The published ratio of 20.4 in the example above has a 95% interval from 5.04 to 82.8 [1].
- Splitting a test with several result levels into positive and negative may discard useful information, since each level has its own likelihood ratio [1].
- A pre-test probability of 0 with an infinite ratio, or of 100% with a ratio of 0, has no defined post-test probability.
Sources
- Deeks and Altman, Diagnostic tests 4: likelihood ratios, BMJ 2004;329:168: definition of a likelihood ratio, the LR+ and LR− formulas, the smoking history example, post-test odds and what large and small ratios mean

