Two-Way Table vs Conditional Probability

Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.

Two-way table

Graphs and displays

A two-way table displays counts for two categorical variables at once, with one variable's categories as rows and the other's as columns.

A two-way table, also called a contingency table, cross-classifies every individual by two categorical variables at once. Each cell holds the count of individuals in that row category and that column category. The row and column totals are the margins and the grand total is nn. Every individual lands in exactly one cell, so the cells add back to nn.

Take 450 applicants to two programs, cross-classified by sex and by admission decision within each program.

ProgramMen admittedWomen admitted
A80 of 10045 of 50
B10 of 10040 of 200
Both90 of 20085 of 250

Collapsed over program, men were admitted at 90/200=0.4590 / 200 = 0.45 and women at 85/250=0.3485 / 250 = 0.34, and the misreading writes itself: "45 percent of men were admitted against 34 percent of women, so the process favored men." Put the third variable back and women were admitted at the higher rate in both programs, 0.90 against 0.80 in A and 0.20 against 0.10 in B. The overall gap comes from where the applicants went, since 200 of the 250 women applied to program B, which admits few of anyone. A comparison that reverses when a lurking variable is restored is Simpson's paradox, and a collapsed two-way table is where it hides.

So a table already summed over a variable you were never shown cannot be un-summed. Neither can a table of percentages: row percentages alone give no counts, no grand total, and therefore no expected counts, so they cannot feed a chi-square test. Percentages are for reading, and counts are what the table has to store.

Two-way tables are topic 2.1, and they are the input to the chi-square test for homogeneity or independence in topics 3.14 and 3.15.

Full entry for two-way table

Conditional probability

Probability

Conditional probability is the chance one event happens when you count only the cases where a second event holds, so that event is the denominator.

Conditional probability shrinks the sample space. P(AB)P(A \mid B), read the probability of A given B, is defined as P(AB)P(B)\frac{P(A \cap B)}{P(B)} whenever P(B)>0P(B) > 0: the outcomes where both happen, divided by the outcomes where the condition holds. The event after the bar is the denominator. Nothing in that definition requires BB to happen first in time, only that you are counting inside it.

Take 1,000 drivers followed for a year. 200 texted at the wheel and 800 did not; 40 of the texting drivers had an accident and 10 of the others did.

AccidentNo accidentTotal
Texting40160200
Not texting10790800
Total509501000

Both conditional probabilities are built from the same 40. P(textingaccident)=40/50=0.80P(\text{texting} \mid \text{accident}) = 40/50 = 0.80, while P(accidenttexting)=40/200=0.20P(\text{accident} \mid \text{texting}) = 40/200 = 0.20. Same numerator, different denominator, a factor of four apart.

Here is the sentence readers actually get wrong: 80 percent of accidents involved a texting driver, so texting gives you an 80 percent chance of crashing. The first clause is P(textingaccident)P(\text{texting} \mid \text{accident}) and the second is P(accidenttexting)P(\text{accident} \mid \text{texting}), which is 0.20. Flipping the bar is not a rephrasing, it is a different quantity, and news copy makes that swap constantly.

As long as both events can occur together, the two directions agree only when the events are equally likely, since dividing the definitions gives P(AB)P(BA)=P(A)P(B)\frac{P(A \mid B)}{P(B \mid A)} = \frac{P(A)}{P(B)}. Here that ratio is 0.05/0.20=0.250.05/0.20 = 0.25, matching 0.20/0.800.20/0.80. So the gap is widest exactly where it does the most damage: a rare outcome conditioned on a common behavior, or the reverse. Topic 2.6 is where the course takes this up.

Full entry for conditional probability

Where each one fits in the course