Contingency table

Row 1
Row 2

TSV: tabs between columns, newlines between rows. Blank cells are errors.

Enter exact nonnegative counts. The total must be positive. P(row | column) divides by the column total; P(column | row) divides by the row total. A zero conditioning total makes only that conditional undefined.

Choose the total that matches the probability

Enter exact nonnegative integer counts for each row/column combination. The table total N must be positive. A cell divided by N is a joint probability; a row or column total divided by N is its marginal probability.

For P(row | column), divide the cell count by its column total. For P(column | row), divide by its row total. A zero conditioning total makes only that conditional category undefined; the remaining probabilities still use their own valid denominators. Counts alone do not establish independence or causality.

Worked example: rows (30, 10) and (20, 40)

The row totals are 40 and 60, the column totals are 50 and 50, and N = 100. The first cell has joint probability 30/100 = 3/10. Row 1 has marginal probability 40/100 = 2/5; column 1 has marginal probability 50/100 = 1/2.

Conditioning on column 1 gives P(row 1 | column 1) = 30/50 = 3/5. Reversing the direction gives P(column 1 | row 1) = 30/40 = 3/4. The cell is the same; the conditioning group changes the denominator.

Load example fills the form without calculating. Choose its primary action to work it out.

Sources and related calculators

The method and worked example here are original. Sources describe the underlying mathematics or notation; calculation choices and limits are in the precision and syntax guide.