AP Statistics · Unit 2 · Topic 2.1

Two-Way Tables and Graphs Study Lab

A two-way table counts individuals by two categorical variables at once. To see whether the variables are associated, compare the distribution of one variable across the groups of the other. Edit the counts, switch which variable you condition on, and watch the graphs and the explanation update.

1. Build a table, then compare groups

Type any counts. The totals, graphs, and conditional distributions update as you type.

Conditional relative frequency = cell count ÷ group total
Preset tables

Two-way table

Graph

Conditional distributions, worked out

Marginal distributions

2. Key ideas

Two-way table

Two variables, one table

Each individual lands in exactly one cell: one category of the row variable and one category of the column variable. The row and column totals are in the margins, and the grand total is in the corner.

Marginal

One variable at a time

The marginal distribution of a variable uses only the totals in the margin. It ignores the other variable completely, so it cannot show association.

Conditional

Within one group

A conditional distribution looks at only the individuals in one group and gives the proportion in each category of the other variable. Each conditional distribution adds up to 1 (or 100%).

Association

Do the groups differ?

Two categorical variables are associated if the conditional distributions differ across groups. If every group has the same conditional distribution, there is no association.

Graphs

Pick the right bar chart

Side-by-side bars show counts, which can mislead when groups are different sizes. Segmented bars show proportions, so each bar is 100% tall. A mosaic plot is a segmented bar chart whose bar widths show the group sizes.

Caution

Association is not causation

Finding an association in observational data does not show that one variable causes the other. A lurking variable might explain both.

3. Worked examples

The table: 200 students by grade (9th, 12th) and whether they drive to school. 9th: 6 drive, 94 do not. 12th: 58 drive, 42 do not.

QuestionWhat to useWorkAnswer
What is the marginal distribution of driving?Column totals ÷ grand total64 ÷ 200, 136 ÷ 20032% drive, 68% do not
What proportion of 12th graders drive?Cell ÷ 12th-grade total58 ÷ 1000.58
What proportion of drivers are 12th graders?Cell ÷ drivers total58 ÷ 64about 0.906
Is grade associated with driving?Compare conditional distributions0.06 for 9th vs. 0.58 for 12thYes. The proportions differ a lot.
Which graph should you use to compare grades?Groups = the explanatory variableOne bar per grade, segmented by drivingSegmented bar chart (or mosaic)

4. On the FRQ

How to earn the points

  • Compare proportions, not counts, when the groups are different sizes: "58% of 12th graders drive compared with only 6% of 9th graders."
  • Name both variables and the context in your conclusion: "There is an association between grade level and driving to school."
  • Make the groups the explanatory variable. Label the axis "Proportion" or "Percent," and include a key for the segments.
  • Show the division: "58/100 = 0.58." Graders want to see which total you divided by.

Common mistakes

  • Dividing by the wrong total. "Of the 12th graders" means divide by the 12th-grade total; "of the drivers" means divide by the drivers total.
  • Concluding association from a side-by-side bar chart of counts when the groups have different sizes.
  • Using marginal distributions to judge association. Only conditional distributions can show it.
  • Saying one variable causes the other just because they are associated.

5. Practice questions

AP-style multiple choice. Pick an answer to see the explanation.

0 / 0 correct

6. Key terms

The vocabulary for topic 2.1. Read the list, flip through flashcards, or quiz yourself. For every term in the unit, see the Unit 2 terminology guide.