2-way Contingency Table Analysis

This page computes various statistics from a 2-by-2 table. It will calculate a Yates-corrected chi-square, along with other quantities relevant to two special kinds of 2-by-2 tables:

  1. analysis of risk factors for unfavorable outcomes (odds ratio, relative risk, difference in proportions, number needed to treat)
  2. analysis of the effectiveness of a diagnostic criterion for some conditions (sensitivity, specificity, positive predictive value, negative predictive value)

Confidence intervals for the estimated parameters are computed by a general method given in: Statistical Methods for Rates and Proportions (2nd Ed.) by Joseph L. Fleiss (Pub: John Wiley & Sons, New York, 1981)

Enter numbers into the four cells below. Make sure that the row and column totals add up correctly. Then click the Compute button.

Outcome Occurred
Outcome did not Occur
Risk Factor Present
or Dx Test Positive
Risk Factor Absent
or Dx Test Negative

Chi Square

Quantities Derived From A 2-by-2 Table
Low 95% CI
Hi 95% CI
Odds Ratio
Relative Risk
Pos Pred Val
Neg Pred Val
Diff in Proportions
# Needed to Treat