About Two-by-Two
Two-by-Two is a free set of epidemiology and evidence-based medicine calculators. It takes its name from the two-by-two table, the four-cell grid of exposed and unexposed, ill and well, positive and negative, that sits underneath almost every number in a clinical trial, a case-control study or a diagnostic accuracy paper. The site exists to make that arithmetic quick, transparent and easy to check, so that the time goes into understanding what the numbers mean rather than into fighting with a spreadsheet.
The Calculators
- Relative Risk & NNT Calculator: risks in two groups, relative risk with a Katz log 95% interval, absolute and relative risk reduction, and the number needed to treat or harm with its interval.
- Odds Ratio Calculator: the cross-product odds ratio of a case-control table, Woolf 95% interval, p value and an optional Zhang–Yu conversion to an approximate risk ratio.
- Diagnostic Test Calculator: sensitivity, specificity, predictive values, likelihood ratios, accuracy and the Youden index, with Wilson intervals for the proportions.
- Post-Test Probability Calculator: the odds form of Bayes’ theorem, from a pre-test probability and either sensitivity and specificity or likelihood ratios.
- Incidence & Prevalence Calculator: incidence rate per person-time with a Byar 95% interval, cumulative incidence, point prevalence and the duration implied by the two.
- Herd Immunity Threshold Calculator: 1 − 1/R₀, the coverage needed at a given vaccine effectiveness, and the effective reproduction number at current coverage.
Who Uses It
The calculators are written for public health, medical, nursing and pharmacy students working through epidemiology and biostatistics courses; for clinicians appraising a paper in a journal club; for candidates preparing for examinations that test these measures; for health journalists who want to turn a “cut the risk by a third” press release into absolute numbers; and for anyone who has wondered what a positive screening result really means.
Methods and Sources
Every formula is a standard one from the epidemiology literature and textbooks, and each calculator page shows the working. Confidence intervals for ratios are calculated on the log scale (Katz for the risk ratio, Woolf for the odds ratio), proportions use the Wilson score interval, rates use Byar’s approximation to the exact Poisson interval, and zero cells are handled with the 0.5 Haldane correction, which the result always flags. The odds-ratio conversion follows Zhang and Yu (1998). The herd immunity threshold is the classic homogeneous-mixing result. Where a method is an approximation, the result says so.
How We Check Accuracy
Each calculator is tested against worked examples whose answers are calculated independently, including edge cases such as zero events, tables with an empty row, extreme proportions and very large counts. The default values that appear when a page opens are the same as the worked example in the text below the calculator, so you can follow every step by hand. The guides use the same formulas, and every number in them is recalculated with the calculators before publication. If you find a discrepancy, the contact page explains what to send.
What the Site Is Not
Two-by-Two is an educational and evidence-appraisal resource. It does not give medical advice, diagnose anyone, recommend treatments or vaccines for an individual, or replace the judgement of a clinician who knows the patient or the guidance of public health authorities. The calculators work with summary counts from studies and populations; they are not designed for, and should not be used with, information about an identifiable person.
Privacy by Design
All calculations run in your browser. The counts, probabilities and rates you enter are not sent to our servers, there are no accounts, and nothing you type is stored by us.
How the Site Is Funded
The site is free to use and is supported by advertising, which may be served by Google AdSense. Advertisers have no influence on the calculators, the methods or the guides, and we do not accept payment to recommend any product, test or treatment.
Contact
Corrections and suggestions are welcome at logan.luo@adsnova.cn.