Course contentsShow
← Data Science
Lesson 98 of 2,1453. Probability FoundationsFree lesson

Conditional Probability with Tables

Work with contingency tables to find conditional probabilities by row, column, and cell proportions.

Conditional Probability with Tables

What you'll learn: How to extract conditional probabilities directly from contingency tables using row, column, and cell proportions.

When you have data organized in a two-way table (also called a contingency table), you already have everything you need to calculate conditional probabilities—no formulas required, just careful reading of the table structure.

Understanding the Table Structure

A contingency table shows counts or frequencies for two categorical variables. Each cell represents how many observations fall into a particular combination of categories. The margins (row and column totals) and the grand total are your navigational tools.

Three Types of Proportions

Cell proportions divide each cell by the grand total, giving you joint probabilities like P(A and B).

Row proportions divide each cell by its row total. Reading across a row answers: "Given this row condition is true, what's the probability of each column outcome?" This gives you P(Column | Row).

Column proportions divide each cell by its column total. Reading down a column answers: "Given this column condition is true, what's the probability of each row outcome?" This gives you P(Row | Column).

Practical Example

Imagine a table showing 100 customers: 60 bought online, 40 in-store; 70 used a coupon, 30 didn't. If 50 online customers used coupons:

  • Cell proportion: 50/100 = 0.50 (joint probability)
  • Row proportion: 50/60 = 0.833 means "given online purchase, 83.3% used coupon"
  • Column proportion: 50/70 = 0.714 means "given coupon use, 71.4% bought online"

The key is identifying which variable is your condition (that determines whether you divide by row or column total).

Key Takeaway: Contingency tables make conditional probabilities visual and computational—just divide by the appropriate marginal total based on which variable is given as your condition.