The display that turns the arithmetic of this chapter into reading. A contingency table shows sample values in relation to two variables that may be dependent on one another, with a cell for every combination, row and column totals in the margins, and a grand total in the corner. A joint probability is one cell over the grand total; a marginal probability is a margin over the grand total; and a conditional probability is a cell over its own row or column total, which is section 3.1's reduced sample space made literal. Section 3.2's independence test becomes a comparison of two fractions read from the same table.
Subject: Statistics · 65 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 3 — Probability Topics
Contingency Tables
Objectives
Five outcomes, and all five are the same skill: choosing the denominator.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 183-188 — the section these objectives are drawn from
Warm-up
Section 3.3's rules each needed a third ingredient — a conditional for the multiplication rule, an intersection for the addition rule — and finding it was usually the whole difficulty.
Discussion prompt
Suppose you had a table showing, for 755 drivers, how many use a phone while driving and how many had a speeding violation, broken down every way. Which of the chapter's quantities would still be hard to find?
Hint: Go through joint, marginal and conditional in turn and ask where each one lives on such a table.
Answer:
None of them would be hard. The number who both use a phone and had a violation is one cell; the number who use a phone at all is a row total; and the number of phone users among those who had a violation is that same cell divided by a column total.
So the intersection that section 3.3 had to compute with the multiplication rule is simply read off, and the conditional the multiplication rule needed is a cell over a margin.
That is what a contingency table is for. The book puts it plainly: the table helps in determining conditional probabilities quite easily. Almost nothing in this section is new mathematics — it is the same three probabilities with a display that makes each one a division of two numbers you can point at.
Concept
A contingency table provides a way of portraying data that can facilitate calculating probabilities, and helps in determining conditional probabilities quite easily. It displays sample values in relation to two different variables that may be dependent or contingent on one another.
contingency table — A table displaying counts for every combination of two variables, with row totals and column totals in the margins and the sample size in the corner. A joint probability is a cell over the grand total, a marginal probability is a margin over the grand total, and a conditional probability is a cell over its own row or column total.
\[ \text{joint} = \frac{\text{cell}}{n} \qquad \text{marginal} = \frac{\text{margin}}{n} \qquad \text{conditional} = \frac{\text{cell}}{\text{its margin}} \]
The word contingent is doing real work in the name: the table is built to show whether one variable's distribution is contingent on the other's. If the conditional probabilities down a column match the marginal probability, the variables are independent and the table has nothing to report. If they differ, the size and direction of the difference is the finding, and section 11.3's chi-square test will decide whether it is larger than chance explains.
Figure (svg): A diagram of the three probabilities a contingency table supplies, showing joint, marginal and conditional with their different denominators
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 183
Section
Section 1
Concept
The table's interior holds one count for each combination of the two variables. The row totals and column totals sit in the margins, and the sample size sits in the corner. The row totals must sum to the grand total, and so must the column totals.
cells and margins — A cell holds the count of members having a particular value of both variables. A margin holds the total for one value of one variable, summed over the other. The grand total is the sample size, and both sets of margins must sum to it.
\[ \sum \text{row totals} = \sum \text{column totals} = n \]
The book draws attention to the check explicitly: the row totals 305 and 450 sum to 755, and the column totals 70 and 685 also sum to 755. Two independent routes to the same number is a genuine test of the table, and it catches a mistyped cell before any probability is computed from it. Every table below is built from its cells with the margins derived, so a wrong count could not pass silently.
Figure (svg): A contingency table of 755 drivers cross-classified by cell phone use and speeding violations, with row totals, column totals and a grand total
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 183-184 — the speeding and cell phone table, with the margin check
Picture it
The book's Example 3.20, with the three kinds of number colour-coded.
Figure (svg): A contingency table of 755 drivers cross-classified by cell phone use and speeding violations, with row totals, column totals and a grand total
There are only nine numbers in the interesting part of the table and every probability in this section is one of them divided by another. Learning to read it is learning which two to pick, and the colour coding is the map: green for a cell, yellow for a margin, red for the grand total.
Worked example
The margin check the book performs, done as a habit.
\[ \text{cells } 25, 280, 45, 405 \]
Add across each row
Why: Twenty-five plus 280; forty-five plus 405.
\[ 305\text{ and } 450 \]
Add down each column
Why: Twenty-five plus 45; 280 plus 405.
\[ 70\text{ and } 685 \]
Total the row totals
Why: Three hundred and five plus 450.
\[ 755 \]
Total the column totals
Why: Seventy plus 685.
\[ 755,\text{ agreeing} \]
Figure (svg): The solution to Worked example checking a table before using it shown as a ladder of expressions, one row per legal move
\[ 305 + 450 = 755 = 70 + 685 \]
Verify: confirm what the check would and would not catch
Why: The two routes agree, so no single cell has been mistyped — changing any one cell would break one row total and one column total and make the two grand totals disagree. What the check cannot catch is a pair of compensating errors, or a table where the counts are internally consistent but simply wrong about the world. It is a proofreading test rather than a validity test, and it costs four additions.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184
Sorting
The speeding table: cells 25, 280, 45, 405; margins 305, 450, 70, 685; corner 755.
Sort into buckets
Sort each number.
The giveaway in the wording is the word AND: a description containing it names a cell, and one without it names a margin. That is also the difference between a joint and a marginal probability, which is the next idea.
Worked example
A table is often given with cells missing, and subtraction fills them.
\[ \text{stretchers: } 55 \text{ injured of } 350; \quad \text{total injured } 286 \text{ of } 800 \]
Find the stretchers not injured
Why: Row total minus the known cell.
\[ 350 - 55 = 295 \]
Find the non-stretchers
Why: Grand total minus the stretchers.
\[ 800 - 350 = 450 \]
Find the non-stretchers injured
Why: Column total minus the known cell.
\[ 286 - 55 = 231 \]
Find the last cell two ways
Why: By its row and by its column.
\[ 450 - 231 = 219 = 514 - 295 \]
Figure (svg): The solution to Worked example completing a partial table shown as a ladder of expressions, one row per legal move
\[ 219 = 450 - 231 \quad \text{and} \quad 219 = 514 - 295 \]
Verify: confirm the last cell was found twice
Why: The final cell can be reached from its row total or from its column total, and both give 219. That agreement is the completion's own check, and it works because a two-by-two table has only one degree of freedom once the margins are fixed — knowing any one interior cell determines the other three. That fact will matter again in section 11.3, where a two-by-two contingency table is said to have one degree of freedom for exactly this reason.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 184-185
Trap
\[ 25 + 280 + 45 + 405 + 305 + 450 + 70 + 685 \]
Sum every number on the table to find the sample size
Why: All the numbers are counts of drivers, so summing them looks reasonable.
\[ = 2265 \quad \text{(each driver counted three times)} \]
Every driver appears once in a cell, once in a row total and once in a column total.
\[ n = 25 + 280 + 45 + 405 = 755 \]
Sum the CELLS only, or read the corner
Why: The margins are summaries of the cells, not additional data.
The cells partition the sample: every member falls in exactly one of them, which is what makes their total the sample size. The margins re-count the same people grouped a different way, so including them triples the count. The same logic explains why the two margins each total 755 independently — each is a complete partition of the sample on its own.
Faded example
The stretching table has row totals 350 and 450 and column totals 286 and 514.
Fill in the blanks
350 + 450 = 800 \qquad 286 + 514 = 800
Why: Both give 800, so the table is internally consistent. Two independent routes to the same grand total is the standard check, and it should be run before any probability is computed from a table.
Two truths and a lie
All three concern the structure of the table.
Eliminate the wrong options
Two are true. Knock those out and keep the false one.
Survives elimination: B
Why: The survivor is false. The margins summarise the cells, so adding everything counts each member three times. The grand total is the sum of the CELLS, which partition the sample, and it also equals either set of margins summed on its own.
Prediction
Commit before reasoning.
Predict first
A two-by-two contingency table has both margins and the grand total filled in. How many interior cells do you need to complete it?
Correct: One.
Why: Once the margins are fixed, filling any single cell forces the other three by subtraction — its row partner, its column partner, and then the last cell from either margin. That is why such a table is described as having one degree of freedom, a phrase section 11.3 will use in exactly this sense when it computes degrees of freedom for a chi-square test of independence.
Section
Section 2
Concept
A joint probability asks what share of the whole sample satisfies both conditions at once. On a contingency table it is one interior cell divided by the grand total.
joint probability — The probability that both events occur, P(A AND B). On a contingency table it is the count in the cell where the two conditions meet, divided by the sample size.
\[ P(A \text{ AND } B) = \frac{\text{cell}}{n} \]
This is section 3.3's intersection, the ingredient the addition rule always needed and which usually had to be found with the multiplication rule. On a table it is simply present. That is the practical reason contingency tables appear so early: they hand you the one quantity that made the earlier problems awkward, and they do it without any assumption about independence.
Figure (svg): A diagram of the three probabilities a contingency table supplies, showing joint, marginal and conditional with their different denominators
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184 — joint probabilities read from the table
Picture it
The joint probability is the first row.
Figure (svg): A diagram of the three probabilities a contingency table supplies, showing joint, marginal and conditional with their different denominators
Notice that the joint and the conditional often share a numerator — the same cell — and differ only in what they are divided by. That is the entire distinction between 'what share of everyone is both' and 'what share of this group is that', and it is worth over-learning here, because from chapter 8 onward the tables disappear and only the words remain.
Worked example
Example 3.20c. The wording contains AND, so a cell is wanted.
\[ P(\text{no violation AND uses a cell phone}) \]
Find the row
Why: Uses a cell phone.
Find the column
Why: No violation in the last year.
Read the cell where they meet
Why: The intersection of that row and column.
\[ 280 \]
Divide by the grand total
Why: Two hundred eighty of 755.
\[ \frac{280}{755} \]
Figure (svg): The solution to Worked example a joint probability shown as a ladder of expressions, one row per legal move
\[ P = \frac{280}{755} \approx 0.371 \]
Verify: confirm the denominator is the whole sample
Why: The question asks what share of ALL the drivers surveyed are both phone users and violation-free, so every one of the 755 is a candidate and the denominator is 755. Had it asked what share of phone users had no violation, the denominator would have been 305 and the answer 0.918 — a very different number from the same cell. Reading which group the question is about, before dividing, is the entire skill.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184
Faded example
The stretching table: 55 athletes both stretch and were injured, out of 800.
Fill in the blanks
P(\text55) = \frac800}___} \approx 0.069
Why: Fifty-five over eight hundred, about 0.069. The numerator is a cell because both conditions are specified, and the denominator is the grand total because the question is about the whole sample.
Worked example
Example 3.20d, using the addition rule with an intersection that is simply read off.
\[ P(\text{uses a cell phone OR had no violation}) \]
Read the two marginals
Why: Row total 305; column total 685.
\[ \frac{305}{755}\text{ and } \frac{685}{755} \]
Read the intersection
Why: The cell where both hold.
\[ \frac{280}{755} \]
Apply the addition rule
Why: Sum minus intersection.
\[ \frac{305 + 685 - 280}{755} \]
Evaluate
Why: Seven hundred and ten of 755.
\[ \frac{710}{755} \]
Figure (svg): The solution to Worked example an OR from the table shown as a ladder of expressions, one row per legal move
\[ P = \frac{305 + 685 - 280}{755} = \frac{710}{755} \approx 0.940 \]
Verify: confirm by counting the excluded drivers
Why: The drivers NOT in the union are those who use no phone and did have a violation — the cell containing 45. And 755 minus 45 is 710, matching. That complement route is often the faster one on a two-by-two table, since a union of a row and a column excludes exactly one cell. It also demonstrates why the subtraction was needed: without it the answer would have been 990 over 755, which exceeds one.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184
Trap
\[ P(\text{uses a phone AND had a violation}) \]
Read the row total for phone users
Why: The question mentions phone users, and 305 is the phone-user number.
\[ \frac{305}{755} \quad \text{(wrong: that ignores the violation condition)} \]
The 305 includes the 280 phone users who had no violation, which the question excludes.
\[ \frac{25}{755} \approx 0.033 \]
A question with AND names a cell; find where the row and column meet
Why: Both conditions must narrow the search.
The error is large here — 0.404 against 0.033, more than a factor of twelve — because the two conditions are very different in size. The reliable habit is to point at the table: locate the row, locate the column, and read where your fingers meet. If only one finger moved, the question was marginal rather than joint.
Sorting
Read for whether the question is about everyone or about a subgroup.
Sort into buckets
Sort each question on the stretching table.
The phrase 'of all athletes' against 'of stretchers' is the whole signal, and it is worth reading for deliberately. Items (a) and (c) share the same numerator of 55 and give 0.069 and 0.157 respectively.
Two truths and a lie
All three concern joint probabilities.
Eliminate the wrong options
Two are true. Knock those out and keep the false one.
Survives elimination: B
Why: The survivor is false unless the two variables happen to be independent. On the speeding table the joint probability of phone use and violation is 25/755, about 0.033, while the product of the marginals is about 0.037 — close but not equal, which is exactly what makes the independence test of the fifth idea worth running.
Estimation
A table has a row total of 305 and a column total of 70, out of 755.
Predict first
What is the largest the cell where they meet could possibly be?
Correct: 70.
Why: The cell is contained in both its row and its column, so it cannot exceed either total — and the smaller of the two, 70, is the binding constraint. This bound is worth knowing because it catches a cell read from the wrong place: any interior number larger than the smaller of its two margins is impossible.
Section
Section 3
Concept
A marginal probability asks what share of the whole sample satisfies one condition, ignoring the other variable entirely. On a contingency table it is a row total or a column total divided by the grand total.
marginal probability — The probability of one event, ignoring the other variable. Read from the margin of the table — a row or column total — divided by the sample size. The name comes from where the number is printed.
\[ P(A) = \frac{\text{row or column total}}{n} \]
The name is literal: these probabilities live in the margins of the table, and that is where the term comes from. What a marginal probability discards is the other variable, which is exactly what makes it the baseline for the independence test. Comparing a conditional with its marginal asks whether knowing the other variable changed anything, and that comparison is the reason the two kinds are printed on the same page.
Figure (svg): Two columns contrasting a marginal probability, computed over the grand total, with a conditional probability, computed over a row or column total
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184 — marginal probabilities from the row and column totals
Picture it
Marginal on the left, conditional on the right.
Figure (svg): Two columns contrasting a marginal probability, computed over the grand total, with a conditional probability, computed over a row or column total
The fifth row is the pair to hold: P(stretches) is 350 over 800 and P(injured given stretches) is 55 over 350. The first says what fraction of everybody stretches; the second says what fraction of the stretchers got hurt. Both are legitimate and they answer completely different questions, which is why a report must say which one it is quoting.
Worked example
Example 3.20a and b, read straight off the margins.
\[ P(\text{driver is a cell phone user}) \quad \text{and} \quad P(\text{driver had no violation}) \]
Locate the phone-user margin
Why: The first row's total.
\[ 305 \]
Divide by the grand total
Why: Three hundred and five of 755.
\[ \frac{305}{755} \]
Locate the no-violation margin
Why: The second column's total.
\[ 685 \]
Divide by the grand total
Why: Six hundred eighty-five of 755.
\[ \frac{685}{755} \]
Figure (svg): The solution to Worked example two marginal probabilities shown as a ladder of expressions, one row per legal move
\[ P = \frac{305}{755} \approx 0.404 \qquad P = \frac{685}{755} \approx 0.907 \]
Verify: confirm each pair of marginals sums to one
Why: The two row marginals are 305 and 450 over 755, which sum to exactly one, and so do the two column marginals of 70 and 685 over 755. That must happen because each variable's categories partition the sample — every driver either uses a phone or does not. It gives a free check on both marginals at once, and it is section 3.1's complement rule appearing as a property of the table.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184
Faded example
The stretching table: 286 of the 800 athletes were injured.
Fill in the blanks
P(\text286) = \frac0.3575}___ \approx ___
Why: The injury column total over the grand total, about 0.358. This is the baseline the conditional probabilities will be compared against in the independence test — it says what share of athletes overall were injured, ignoring whether they stretched.
Worked example
The same number, described two ways.
\[ \text{Of } 800 \text{ athletes}, 350 \text{ stretch.} \]
Compute the marginal
Why: Three hundred fifty of eight hundred.
\[ 0.4375 \]
Ask what it ignores
Why: Nothing about injury enters the calculation.
Rebuild it from the cells
Why: The injured and uninjured stretchers.
\[ 55 + 295 = 350 \]
Note the equivalence
Why: The margin is the sum of its row's cells.
Figure (svg): The solution to Worked example which variable a marginal ignores shown as a ladder of expressions, one row per legal move
\[ P(\text{stretches}) = \frac{55 + 295}{800} = \frac{350}{800} = 0.4375 \]
Verify: confirm why summing the row is the same as ignoring the column variable
Why: Adding the injured and uninjured stretchers collects every stretcher regardless of injury, which is precisely what ignoring the injury variable means. So a marginal probability is a joint probability summed over the other variable, and that is the general definition — the phrase 'marginalising out' a variable, used throughout statistics, means exactly this summation. It is why the margins are the right place to print these numbers.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 184-185
Error analysis
On the speeding table, a student is asked for the probability that a driver uses a cell phone. Four answers are offered.
Annotate
On: \( \begin{aligned} &(1)\; \tfrac{25}{755} \\ &(2)\; \tfrac{25}{70} \\ &(3)\; \tfrac{305}{450} \\ &(4)\; \tfrac{305}{755} \end{aligned} \)
All four use numbers genuinely present on the table, which is what makes the errors easy to commit and hard to spot. The defence is to name the denominator before looking for a numerator: an unconditional question always divides by the grand total.
Discrimination
Ask whether the description pins down one variable or both.
Sort into buckets
Sort each probability on the speeding table.
Two truths and a lie
All three concern marginal probabilities.
Eliminate the wrong options
Two are true. Knock those out and keep the false one.
Survives elimination: B
Why: The survivor is false. On the stretching table P(injured) is about 0.358 while P(injured given does not stretch) is 231 over 450, about 0.513 — the conditional is considerably larger. Conditioning can raise or lower a probability, and which way it moves is precisely the finding the table exists to deliver.
Prediction
Commit before reasoning.
Predict first
P(stretches) is computed as 350 over 800. What role does the injury variable play?
Correct: None: the marginal ignores it entirely.
Why: The row total of 350 is the injured stretchers plus the uninjured ones, so both categories are included and the distinction is discarded. That is what marginalising a variable out means, and it requires no assumption about independence — the sum is valid whatever the relationship between the two variables.
Section
Section 4
Concept
A conditional probability asks what share of one group satisfies the other condition. On a contingency table it is a cell divided by its own row total or column total, because conditioning reduces the sample space to that row or column.
conditional probability from a table — The count in a cell divided by the total of the row or column that identifies the condition. The book notes that the sample space is reduced to the members satisfying the condition, which on a table means discarding every row or column but one.
\[ P(A\mid B) = \frac{\text{cell}}{\text{the margin for } B} \]
This is section 3.1's reduced sample space made completely literal. Conditioning on a violation means the 685 drivers without one are no longer candidates, so the table loses a column and the denominator becomes 70. The book says exactly this in its solution to Example 3.20e, noting that the sample space is reduced to the number of drivers who had a violation.
Figure (svg): A contingency table shown twice, the second time with only the violation column active, illustrating that conditioning discards the rest of the table
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184 — conditional probabilities and the reduced sample space
Picture it
Conditioning on a violation discards the other 685 drivers.
Figure (svg): A contingency table shown twice, the second time with only the violation column active, illustrating that conditioning discards the rest of the table
Only the shaded column is still in play, so the denominator is its total of 70 rather than 755. The comparison at the bottom is the substantive one: about 40 percent of all drivers use a phone, but only about 36 percent of the drivers who had a violation do — so in this fictional data, violators are slightly LESS likely to be phone users than drivers in general, which is not what the study was presumably designed to find.
Worked example
Example 3.20e. The book flags the reduced sample space in its own solution.
\[ P(\text{driver is a cell phone user} \mid \text{driver had a violation}) \]
Identify the condition
Why: Had a violation in the last year.
Read that column's total
Why: The reduced sample space.
\[ 70\text{ drivers} \]
Read the cell for phone users within it
Why: Where the phone row meets that column.
\[ 25 \]
Divide
Why: Twenty-five of seventy.
\[ \frac{25}{70} \]
Figure (svg): The solution to Worked example conditioning on a column shown as a ladder of expressions, one row per legal move
\[ P = \frac{25}{70} \approx 0.357 \]
Verify: confirm the denominator is not the grand total
Why: Dividing 25 by 755 instead would give about 0.033, which answers the joint question rather than the conditional one. The book's own note is the guard: the sample space is reduced to the number of drivers who had a violation. On a table that reduction is visible — a whole column has been discarded — and the denominator is whatever the surviving column totals.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, p. 184
Faded example
The stretching table: 55 of the 350 stretchers were injured.
Fill in the blanks
P(\text350 \mid \text0.157) = \frac______} \approx ___
Why: About 0.157. Compare the same conditional for non-stretchers, 231 over 450 or about 0.513 — more than three times as high, which is the finding this table was built to deliver.
Worked example
Example 3.20f. The same operation in the other direction.
\[ P(\text{no violation} \mid \text{not a cell phone user}) \]
Identify the condition
Why: Does not use a cell phone.
Read that row's total
Why: The reduced sample space.
\[ 450\text{ drivers} \]
Read the cell for no violation within it
Why: Where that row meets the no-violation column.
\[ 405 \]
Divide
Why: Four hundred and five of four hundred and fifty.
\[ \frac{405}{450} = 0.9 \]
Figure (svg): The solution to Worked example conditioning on a row shown as a ladder of expressions, one row per legal move
\[ P = \frac{405}{450} = 0.9 \]
Verify: compare with the same conditional for phone users
Why: Among phone users, the no-violation rate is 280 over 305, about 0.918 — slightly HIGHER than the 0.9 for non-users. So in this fictional data phone users are marginally less likely to have a violation, which is the opposite of what one would expect and a reminder that the book calls the data fictional. The comparison of two conditionals down the same column is the standard way to read a contingency table for an association, and it is what the next idea formalises.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 184-185
Trap
\[ P(\text{phone user} \mid \text{violation}) = \frac{25}{305} \]
Divide the cell by the phone-user row total
Why: The event in the numerator is about phone users, so 305 looks like the right total.
\[ \approx 0.082 \quad \text{(that is } P(\text{violation} \mid \text{phone user})\text{)} \]
The denominator must be the total for the CONDITION, which is the violation column at 70, not the phone-user row.
\[ P(\text{phone user} \mid \text{violation}) = \frac{25}{70} \approx 0.357 \]
The margin after the bar supplies the denominator
Why: Read the bar as 'within', and divide by the total of the group named after it.
The two answers, 0.082 and 0.357, are the two conditionals from section 3.1 that share a numerator and differ in denominator, and they differ by more than a factor of four here. Saying the question aloud in full — 'of the drivers who had a violation, what share use a phone' — names the denominator first and makes the choice automatic.
Sorting
The group named after the bar supplies the denominator.
Sort into buckets
Sort each conditional on the speeding table.
Which margin you divide by is decided entirely by what comes AFTER the bar, never by what comes before it. Items (a) and (b) use the same cell of 25 and give 0.357 and 0.082 respectively.
Two truths and a lie
All three concern conditionals on a table.
Eliminate the wrong options
Two are true. Knock those out and keep the false one.
Survives elimination: B
Why: The survivor is false, and in fact the reverse always holds. Both have the same numerator, and the conditional divides by a margin while the joint divides by the larger grand total, so the conditional is always the larger of the two. On the speeding table, 25/70 exceeds 25/755 by a factor of more than ten.
Prediction
Commit before reasoning.
Predict first
P(injured) is about 0.358 and P(injured | does not stretch) is about 0.513. What does that say?
Correct: Not stretching is associated with a higher injury rate.
Why: The conditional exceeds the marginal, so knowing an athlete does not stretch raises the estimated chance of injury from about 36 percent to about 51 percent. That is an association, and section 1.4's lesson applies: these are observational data, so the causal direction is not established — athletes may skip stretching because of an existing problem, or a third factor may drive both.
Section
Section 5
Concept
Section 3.2's first condition for independence says that the conditional probability equals the unconditional one. On a contingency table both numbers are available, so the test is a comparison of two fractions — one from a cell over its margin, one from a margin over the grand total.
independence on a table — Two variables are independent when conditioning on one does not change the other's probability. On a table this means every conditional along a row or column equals the corresponding marginal probability; equivalently, each cell equals its row total times its column total divided by the grand total.
\[ \text{independent} \;\iff\; \frac{\text{cell}}{\text{row total}} = \frac{\text{column total}}{n} \]
The equivalent form on the right is worth carrying forward: under independence, each cell should equal its row total times its column total, all divided by the grand total. That expression is the EXPECTED count of section 11.3, where the chi-square test of independence compares every observed cell with exactly this quantity. So this idea is the informal version of a formal test that arrives eight chapters later.
Figure (svg): A contingency table of 800 athletes cross-classified by whether they stretch before exercising and whether they were injured in the last year
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 183-188 — the table as a way of examining dependence between two variables
Picture it
The two highlighted cells are the comparison.
Figure (svg): A contingency table of 800 athletes cross-classified by whether they stretch before exercising and whether they were injured in the last year
The two rows have different sizes — 350 stretchers against 450 non-stretchers — so the raw counts of 55 and 231 cannot be compared directly. Converting each to a rate within its own row gives 0.157 against 0.513, and that is the honest comparison. It is the same argument section 1.2 made for percentage columns when the two colleges had different enrolments.
Worked example
Are stretching and injury independent in this sample?
\[ \text{55 of 350 stretchers injured; 286 of 800 athletes injured} \]
Compute the marginal
Why: All injured over all athletes.
\[ \frac{286}{800} = 0.3575 \]
Compute the conditional
Why: Injured stretchers over all stretchers.
\[ \frac{55}{350} = 0.1571 \]
Compare them
Why: 0.157 against 0.358.
Conclude
Why: The condition changed the probability.
Figure (svg): The solution to Worked example testing independence shown as a ladder of expressions, one row per legal move
\[ P(\text{inj}\mid\text{str}) = 0.157 \ne 0.358 = P(\text{inj}) \]
Verify: confirm with the expected-count form
Why: Under independence the stretch-and-injured cell would hold 350 times 286 divided by 800, which is about 125. The observed count is 55 — less than half of it. That is the same conclusion by the route section 11.3 will formalise, and expressing it as a count rather than a probability makes the size of the discrepancy vivid: seventy fewer injured stretchers than independence predicts.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 185-186
Faded example
The stretching table: row total 350, column total 286, grand total 800.
Fill in the blanks
\text125 = \frac55___ \approx ___, \text___ ___
Why: Independence predicts about 125 injured stretchers and the table shows 55 — a shortfall of seventy athletes. This expected-count form is exactly the quantity section 11.3's chi-square test compares against each observed cell.
Worked example
The speeding table, where the association is weak.
\[ \text{25 of 305 phone users had a violation; 70 of 755 drivers did} \]
Compute the marginal
Why: All violations over all drivers.
\[ \frac{70}{755} = 0.0927 \]
Compute the conditional
Why: Violations among phone users.
\[ \frac{25}{305} = 0.0820 \]
Compare them
Why: 0.082 against 0.093.
Conclude
Why: Not exactly independent in this sample.
Figure (svg): The solution to Worked example a near-independent pair shown as a ladder of expressions, one row per legal move
\[ P(\text{viol}\mid\text{phone}) = 0.082 \quad \text{against} \quad P(\text{viol}) = 0.093 \]
Verify: confirm what such a small gap can and cannot establish
Why: The two figures differ by about a percentage point, which is far smaller than the stretching table's twenty. A gap this small in a sample of 755 could easily be produced by chance even if the two variables were exactly independent in the population — and deciding whether an observed gap is larger than chance explains is precisely what a hypothesis test does. Section 11.3's chi-square test of independence answers exactly this question, and until then the honest report is that the sample shows a weak association whose significance is untested.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 184-188
Trap
\[ 55 \text{ injured stretchers against } 231 \text{ injured non-stretchers} \]
Conclude that not stretching is four times as dangerous
Why: The counts are four times apart, so the risk looks four times apart.
\[ \text{but there are also more non-stretchers} \quad \text{(450 against 350)} \]
Some of the difference in counts is simply that the second group is larger.
\[ \frac{55}{350} = 0.157 \quad \text{against} \quad \frac{231}{450} = 0.513 \]
Convert each count to a rate within its own row before comparing
Why: Different group sizes make raw counts incomparable.
The correct comparison is 0.157 against 0.513, a factor of about 3.3 rather than 4.2, so the raw counts overstated the difference by about a quarter. This is section 1.2's argument for percentage columns in exactly the setting it was built for, and it is why a contingency table is nearly always read as a set of conditional probabilities rather than as counts.
Discrimination
Compare each conditional with its marginal.
Sort into buckets
Sort each comparison.
Two truths and a lie
All three concern independence on a table.
Eliminate the wrong options
Two are true. Knock those out and keep the false one.
Survives elimination: B
Why: The survivor is false and it is section 1.4's lesson in a new setting. A difference establishes association in the sample and nothing about cause: athletes may skip stretching because of an existing injury, or a third factor may drive both. Nor does it establish that the association exists in the population, which needs a test.
Explain it
A classmate says the stretching table proves stretching prevents injury, because 55 is much less than 231.
Discussion prompt
In three sentences or fewer, name both problems with that reasoning.
Hint: One is arithmetic and one is about study design.
Answer:
First, the counts are not comparable: there are 350 stretchers and 450 non-stretchers, so some of the gap between 55 and 231 is just group size. The rates are 0.157 and 0.513, which is a real difference but a smaller one than the counts suggest.
Second, this is observational data, so even the rate difference shows only association — athletes with existing problems may avoid stretching, which would produce the same table with the causation running backwards.
What the table honestly supports is that stretching and injury are associated in this sample, and establishing cause would need the randomised design of section 1.4.
Comparison
Fill the blanks. The numerator is often the same; the denominator is the question.
Comparison matrix
| Probability | Numerator | Denominator |
|---|---|---|
| Joint, P(A AND B) | the cell where the row and column meet | the grand total |
| Marginal, P(A) | a row or column total | the grand total |
| Conditional, P(A given B) | the cell where the row and column meet | the margin for B alone |
| The independence test | compare a conditional with its marginal | equal means independent |
Rows one and three share a numerator and differ only in what they divide by, which is why the two are so easily confused and why the wording must be read for a condition before anything is computed. Everything a contingency table can tell you is one of these four operations.
Pattern
Six steps, and the third is the one that decides the answer.
For an association, compare a conditional with its marginal, or compare the same conditional across the two rows. Never compare raw counts from rows of different sizes.
OpenStax Introductory Business Statistics 2e, §3.4 Contingency Tables and Probability Trees §3.4 Contingency Tables and Probability Trees
Check
Joint or marginal.
Check your understanding
On the speeding table, what is the probability that a driver uses a cell phone and had a violation?
Answer: A
Why: Both variables are specified, so the numerator is the cell where the phone row meets the violation column, and no condition is named, so the denominator is the grand total.
Check
Find the denominator.
Check your understanding
On the stretching table, what is P(injured given the athlete does not stretch)?
Answer: A
Why: The condition names the non-stretchers, so the denominator is that row's total of 450, and the numerator is the injured cell within that row.
Check
The expected count.
Check your understanding
A table has a row total of 350, a column total of 286 and a grand total of 800. If the variables were independent, what count would the cell hold?
Answer: A
Why: Under independence a cell equals its row total times its column total divided by the grand total, which is 350 times 286 over 800, about 125.
Real world
A hospital reports that of the patients who died last year, 62 percent had been treated at the new unit. A newspaper reports this as evidence that the new unit is dangerous. The hospital's full table shows 2,000 patients treated at the new unit with 124 deaths, and 6,000 at the old unit with 76 deaths.
Discussion prompt
Build the table, compute the probability the newspaper quoted and the one it should have quoted, and say which is relevant.
Hint: Ask which margin each figure divides by.
Answer:
The newspaper quoted a conditional in the wrong direction. There were 200 deaths in total, 124 of them at the new unit, so P(new unit given died) is 124 over 200, which is 62 percent. That is a fact about the deaths, not about the units.
The relevant figure conditions the other way. P(died given new unit) is 124 over 2,000, or 6.2 percent, against 76 over 6,000, or 1.3 percent, at the old unit. Those are the two death rates, and they are what a patient choosing a unit would want.
Both figures are correct and only one answers the question. The 62 percent is inflated partly because the new unit treats a quarter of the patients, and the honest comparison is between the two rates within their own rows — which does show a much higher death rate at the new unit, by a factor of nearly five.
\[ P(\text{new}\mid\text{died}) = \frac{124}{200} = 0.62 \qquad P(\text{died}\mid\text{new}) = \frac{124}{2000} = 0.062 \]
Two further points belong in any honest report. The new unit may take the sickest patients, which would produce this table with no difference in quality of care — section 1.4's lurking variable, here called case mix, and the reason hospital mortality figures are risk-adjusted. And whether a difference this size could arise by chance is a question for a hypothesis test. The table settles the arithmetic and settles nothing else.
Commit first
Answer, then rate your confidence honestly.
Predict first
On a contingency table, what distinguishes a joint probability from a conditional probability?
Correct: The denominator.
\[ \frac{25}{755} = 0.033 \quad \text{against} \quad \frac{25}{70} = 0.357: \text{ same cell, different question} \]
Why: Both use the same cell as the numerator. What differs is what that cell is divided by: the whole sample for a joint probability, or the total of the group named by the condition for a conditional. Because a margin is smaller than the grand total, the conditional is always the larger of the two — so option three has it exactly backwards.
Explain it
They have divided a cell by the grand total for a question that said 'given'.
Discussion prompt
In three sentences or fewer, show them what the condition changed.
Hint: Ask them who is still in the running once the condition is known.
Answer:
Ask them: once you know the driver had a violation, how many of the 755 are still possible? Only the 70 in that column — the other 685 have been ruled out.
So the denominator has to be 70, because the condition shrank the group you are choosing from; dividing by 755 answers what share of everybody is both, which is a different question.
On a table the reduction is visible: conditioning crosses out every column but one, and whatever that column totals is what you divide by.
Exit ticket
Name the weakest spot before you close the deck.
Predict first
Which of these would you least want handed to you cold?
Correct: Whichever you picked is tonight's ten minutes, and each has a one-line fix.
Why: For completing a table, fill by subtraction and reach the last cell two ways. For joint against marginal, ask whether the description names both variables or one. For a conditional, divide by the margin of the group named AFTER the bar. For independence, compare a conditional with its marginal, and convert counts to rates before comparing rows. Do five questions of your chosen kind rather than twenty mixed ones.
Connect it up
Paper. Fifteen minutes.
Draw it
At the top, draw the speeding table in full: 25 and 280 in the phone row, 45 and 405 in the no-phone row, with both margins and the grand total. Check that the row totals and the column totals each sum to 755, and write both sums. Beneath it, compute and label six probabilities, writing the fraction and saying in words which group each denominator represents: P(uses a phone), P(no violation), P(phone AND no violation), P(phone OR no violation), P(phone given a violation), and P(no violation given no phone). Beside each, write J, M or C for joint, marginal or conditional. In the middle, draw the table a second time with every column but the violation column crossed out, and write the conditional that reduced table computes. At the bottom, build the stretching table from these facts: 800 athletes, 350 stretch, 55 of those were injured, 286 were injured in total. Fill all four cells by subtraction, reaching the last one two ways. Then compute the injury rate within each row, compute the expected count for the stretch-and-injured cell under independence, and write one sentence saying what the comparison shows and one saying what it does not establish.
Check your six probabilities: exactly three should divide by 755 and two by a margin, and the OR should come out at 710 over 755. If a conditional came out smaller than the corresponding joint probability, the denominator was the grand total by mistake — a conditional is always the larger of the two.
Recap
Four operations on one table, and all four are a choice of denominator.
| If you see | Then |
|---|---|
| A description naming both variables | A cell |
| A description naming one variable | A margin |
| No condition in the wording | Divide by the grand total |
| Given, of those who, among the | Divide by that group's margin |
| Counts from rows of different sizes | Convert each to a rate before comparing |
| A conditional equal to its marginal | The variables are independent on this evidence |
| A conditional far from its marginal | An association, whose cause the table cannot settle |
Section 3.5 adds the last two displays of the chapter. A tree diagram lays out a sequence of stages with a probability on every branch, so a path's probability is the product along it — the multiplication rule drawn. A Venn diagram shows two events as overlapping regions, so the addition rule becomes a statement about area.
OpenStax Introductory Statistics 2e, §3.4 Contingency Tables §3.4, pp. 183-188 — everything on these slides traces back here
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.