How to read a two-way table: joint, marginal, conditional

By Jude Wallis · Published

A two-way table answers three probability questions that differ only in the denominator. Joint divides one cell by the grand total. Marginal divides a row or column total by the grand total. Conditional divides one cell by its own row or column total.

AP Statistics: Unit 2 (topics 2.1 Tabular and Graphical Representations for the Distributions of Two Categorical Variables, 2.2 Summary Statistics for Two Categorical Variables). Two-way tables and the graphs that display them are topic 2.1 of Unit 2 in the Fall 2026 AP Statistics course, and the joint, marginal, and conditional relative frequencies computed here are topic 2.2.

Three probabilities, three denominators

Every probability you read off a two-way table is one count divided by another count. Finding the numerator is rarely the hard part. Picking the denominator is, and that single choice is the whole difference between a joint probability, a marginal probability, and a conditional probability.

  • Joint: one cell divided by the grand total. The chance that both things are true of a randomly chosen individual.
  • Marginal: a row total or a column total divided by the grand total. The chance that one thing is true, with the other variable ignored.
  • Conditional: one cell divided by that cell's own row total or column total. The chance that one thing is true among only the individuals for whom the other is already true.

The rest of this page reads all three off the same table, using the same cell, so you can watch one count of 48 turn into 0.120.12, 0.300.30, and 0.46150.4615 depending on what sits underneath it.

The parts of the table

Lakeview High asked all 400 of its students two questions: how they usually get to school, and whether they were late to first period at least once last week. Both answers are categorical, so a two-way table, also called a contingency table, holds the result.

Usual rideOn time all weekLate at least onceTotal
Bus11248160
Car11921140
Walk6535100
Total296104400

Three regions of that table do three different jobs.

  • The six cells in the interior count students who gave a specific pair of answers. The 48 is students who ride the bus and were late.
  • The margins are the outer totals. The right margin (160, 140, 100) describes how students travel and says nothing about lateness. The bottom margin (296, 104) describes lateness and says nothing about travel.
  • The grand total, 400, is every student in the survey.

Check the table before you use it. Each row's cells should add to that row's total, each column's cells should add to that column's total, and both margins should add to the grand total: 160+140+100=400160 + 140 + 100 = 400 and 296+104=400296 + 104 = 400.

Joint probability: a cell over the grand total

A joint probability is the chance that a randomly chosen student falls in one specific cell, so both categories describe that student at once. The AP course calls the count version a joint relative frequency: a cell frequency divided by the total for the entire table.

P(buslate)=48400=0.12P(\text{bus} \cap \text{late}) = \frac{48}{400} = 0.12

The symbol \cap is read "and" (formally, intersect). So about 12 percent of all Lakeview students are bus riders who were late at least once.

Every cell gives one joint probability, and because the six cells account for each student exactly once, the six joint probabilities add to 1:

112+48+119+21+65+35400=400400=1\frac{112 + 48 + 119 + 21 + 65 + 35}{400} = \frac{400}{400} = 1

That check is worth doing. If your joint probabilities do not add to 1, you have used the wrong denominator somewhere.

Marginal probability: a margin over the grand total

A marginal probability is the chance that one category describes a randomly chosen student, with the second variable ignored entirely. The name comes from where the number lives, out in the margin of the table.

P(bus)=160400=0.40P(late)=104400=0.26P(\text{bus}) = \frac{160}{400} = 0.40 \qquad P(\text{late}) = \frac{104}{400} = 0.26

The denominator is still 400, exactly as it was for a joint probability. What changed is the numerator: a whole row total or column total instead of a single cell.

Collect a full margin and you have a marginal distribution. For usual ride that is 0.400.40 bus, 0.350.35 car, 0.250.25 walk, which adds to 1. For lateness it is 0.740.74 on time all week and 0.260.26 late at least once, which also adds to 1. A marginal distribution is what you would have reported if you had only asked one of the two questions.

Conditional probability: a cell over its own row or column total

A conditional probability throws away most of the table first. You keep only the group the question names, then ask what fraction of that group falls in the cell. The AP course calls this a conditional relative frequency: a cell frequency divided by the total for its row, or a cell frequency divided by the total for its column.

P(latebus)=48160=0.30P(\text{late} \mid \text{bus}) = \frac{48}{160} = 0.30

The vertical bar is read "given". Here the condition is "bus", which is a row, so the denominator is the bus row total of 160. Among bus riders only, 30 percent were late at least once.

Flip the condition and the denominator moves to the other margin:

P(buslate)=481040.4615P(\text{bus} \mid \text{late}) = \frac{48}{104} \approx 0.4615

Now the condition is a column, so you divide by 104. Both fractions sit on the same 48, and neither one is the joint probability of 0.120.12. One cell, three denominators, three answers. Which conditional a question wants is decided by the words "given", "among", or "of the", worked out in P(A|B) vs P(B|A).

Reading a conditional distribution

A single conditional probability answers one question. A conditional distribution answers all of them for one group at once: take a whole row and divide every entry by that row's total.

Usual rideOn time all weekLate at least once
Bus112160=0.70\frac{112}{160} = 0.7048160=0.30\frac{48}{160} = 0.30
Car119140=0.85\frac{119}{140} = 0.8521140=0.15\frac{21}{140} = 0.15
Walk65100=0.65\frac{65}{100} = 0.6535100=0.35\frac{35}{100} = 0.35

Each row now adds to exactly 1, because every bus rider was either on time all week or late at least once. That is the check that tells you that you divided by the right total. A row adding to something other than 1 means you reached for the grand total or the wrong margin.

Rows are not the only choice. Dividing each entry of a column by its column total gives the conditional distribution of usual ride among on-time students, or among late students. Pick the direction the question asks about, then say which direction you used when you write the answer.

What the table says about association

Two categorical variables are associated when the conditional distribution of one changes as you move across the levels of the other. Line up the late rates from the table above: 0.300.30 for bus riders, 0.150.15 for car riders, 0.350.35 for walkers. Those three are not the same, so usual ride and lateness are associated in this sample.

Compare that with what no association would look like. Every row would show the same split, and that split would match the bottom margin of 0.740.74 and 0.260.26. Each row's conditional distribution would be a copy of the overall one.

Segmented bar charts and mosaic plots draw exactly this comparison, one bar per row, each bar split identically when there is no association. The picture and the arithmetic report the same thing.

Two cautions. An association in a sample is not proof of an association in the population, and association is not causation, since walkers might live closest to school and leave latest for reasons that have nothing to do with walking, as correlation vs causation works through. To test one specific pair of events instead of eyeballing the rows, use the independence check.

What the AP exam asks for

Two-way tables open Unit 2 of the Fall 2026 AP Statistics course, and Unit 2 is 15 to 25 percent of the multiple-choice section.

Topic 2.1 covers the table itself along with the graphs that carry the same information: side-by-side bar charts, segmented bar charts, and mosaic plots. The stated purpose is comparing one categorical variable across the levels of the other and deciding whether the two are associated.

Topic 2.2 covers the arithmetic, using the word "frequency" where this page has said "probability":

  • joint relative frequency: a cell frequency divided by the total for the entire table
  • marginal relative frequency: a row total or a column total divided by the total for the entire table
  • conditional relative frequency: a cell frequency divided by the total for its row or for its column

Free-response questions usually ask you to compute one of these and then interpret it in context, so name the group in your sentence. "Of the 160 bus riders, 30 percent were late at least once" cannot be misread; "0.30" can. Practice the reading step on the conditional probability set, and see the official framework at AP Central.

Four probabilities from the car row

Using the Lakeview table of 400 students, find the probability that a randomly chosen student rides a car and was on time all week, the probability that a student rides a car, the probability that a student was on time all week given that the student rides a car, and the probability that a student rides a car given that the student was on time all week.

  1. Locate the cell. Car and on time all week is 119 students. The car row total is 140, the on-time column total is 296, and the grand total is 400.

  2. Joint probability: divide the cell by the grand total. P(caron time)=119400=0.2975P(\text{car} \cap \text{on time}) = \frac{119}{400} = 0.2975.

  3. Marginal probability: divide the row total by the grand total. P(car)=140400=0.35P(\text{car}) = \frac{140}{400} = 0.35.

  4. First conditional. The condition is "rides a car", a row, so divide the cell by the row total: P(on timecar)=119140=0.85P(\text{on time} \mid \text{car}) = \frac{119}{140} = 0.85.

  5. Second conditional. The condition is now "on time all week", a column, so divide the same cell by the column total: P(caron time)=1192960.4020P(\text{car} \mid \text{on time}) = \frac{119}{296} \approx 0.4020.

  6. Audit with the definition P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}. Since P(on time)=296400=0.74P(\text{on time}) = \frac{296}{400} = 0.74, you get 0.29750.35=0.85\frac{0.2975}{0.35} = 0.85 and 0.29750.740.4020\frac{0.2975}{0.74} \approx 0.4020, matching the counts.

  7. Say each value as a sentence. 29.75 percent of all students are car riders who were on time all week; 35 percent of all students ride a car; 85 percent of car riders were on time all week; about 40.20 percent of the on-time students ride a car.

P(caron time)=119400=0.2975P(\text{car} \cap \text{on time}) = \frac{119}{400} = 0.2975, P(car)=140400=0.35P(\text{car}) = \frac{140}{400} = 0.35, P(on timecar)=119140=0.85P(\text{on time} \mid \text{car}) = \frac{119}{140} = 0.85, and P(caron time)=1192960.4020P(\text{car} \mid \text{on time}) = \frac{119}{296} \approx 0.4020. The same 119 students sit on top of three of those four fractions, and only the denominator changes.

The conditional distribution of usual ride among late students

Using the same table of 400 Lakeview students, find the conditional distribution of usual ride among the students who were late at least once, then compare it with the marginal distribution of usual ride.

  1. Pick the group. "Late at least once" is a column, and that column total is 104, so 104 is the denominator for every entry.

  2. Confirm the column adds up: 48+21+35=10448 + 21 + 35 = 104.

  3. Divide each cell in that column by 104. Bus: 481040.4615\frac{48}{104} \approx 0.4615. Car: 211040.2019\frac{21}{104} \approx 0.2019. Walk: 351040.3365\frac{35}{104} \approx 0.3365.

  4. Check the total. 0.4615+0.2019+0.3365=0.99990.4615 + 0.2019 + 0.3365 = 0.9999, which is 1 apart from rounding. The unrounded values add to exactly 1, since 48+21+35104=1\frac{48 + 21 + 35}{104} = 1.

  5. Write down the marginal distribution for comparison: 160400=0.40\frac{160}{400} = 0.40 bus, 140400=0.35\frac{140}{400} = 0.35 car, 100400=0.25\frac{100}{400} = 0.25 walk.

  6. Compare category by category. Bus riders are 40 percent of all students but about 46.15 percent of the late students. Car riders are 35 percent of all students but only about 20.19 percent of the late students. Walkers are 25 percent of all students and about 33.65 percent of the late students.

  7. Interpret. The conditional distribution differs from the marginal distribution, so knowing that a student was late changes what you would guess about how that student travels. That is what association looks like in a two-way table.

Among the 104 students who were late at least once, about 46.15 percent ride the bus, 20.19 percent ride a car, and 33.65 percent walk. The marginal distribution is 40 percent, 35 percent, and 25 percent, so car riders are strongly under-represented among late students and the two variables are associated.

Frequently asked questions

What is the difference between a joint and a marginal probability?

Both divide by the grand total. A joint probability has a single cell on top, so it is the chance that both categories describe the same individual. A marginal probability has a row total or a column total on top, so it is the chance that one category describes the individual, with the other variable ignored. In the Lakeview table, 48400=0.12\frac{48}{400} = 0.12 is joint and 160400=0.40\frac{160}{400} = 0.40 is marginal.

How do I know whether to divide by the row total or the column total?

Find the group the question restricts you to, then find that group in the table. If it is a row, use the row total; if it is a column, use the column total. The signal words are "given", "among", "of the", and "if". "Of the bus riders" points at the bus row, so the denominator is 160.

Do conditional relative frequencies have to add to 1?

Yes, within a single row or a single column. Every bus rider falls in exactly one of the two lateness categories, so 112160+48160=1\frac{112}{160} + \frac{48}{160} = 1. If your numbers do not add to 1, you almost certainly divided one of them by the grand total by mistake.

The table gives percentages instead of counts. Does anything change?

The method is the same, but read the labels, because a table of percentages has already chosen a denominator for you. Percentages that add to 100 across the whole table are joint relative frequencies. Percentages that add to 100 within each row are conditional relative frequencies for that row. Counts are more flexible, since counts let you build any of the three.

Does an association in a two-way table mean one variable causes the other?

No. A two-way table usually summarizes observational data, so a confounding variable can produce the association on its own. The table can show that late rates differ across travel methods without supporting any claim about why they differ.