Skip to lesson

Math · AP Statistics

Chapter 7: Chi-Square Procedures

Chi-Square for Two-Way Tables

Independence and homogeneity.

Lesson
2
Time
About 22 minutes
0 of 12 done

Step 1: Let's Learn

Read it, or press Listen and follow the words.

A two-way chi-square test asks whether two categorical variables are related, using a table of counts.

Expected counts

For each cell, multiply its row total by its column total and divide by the grand total.

Degrees of freedom

For a table, df = (rows − 1) × (columns − 1). A 3 by 4 table gives 6.

Test of independence

One sample is classified by two variables at once. The question is whether the two are associated.

Test of homogeneity

Several separate samples are compared on one variable. The question is whether the groups have the same distribution.

Same arithmetic, different conclusion

The computation is identical. What differs is how the data was collected and how the conclusion is worded.

Independence or homogeneity

Independence tests one sample classified two ways; homogeneity tests several samples on one variable. The arithmetic is identical and the hypotheses are worded differently, which the exam distinguishes.

Expected counts from the margins

Each expected count is the row total times the column total divided by the grand total. That formula is exactly what independence would predict, which is why it defines the null model.

Degrees of freedom

(rows − 1)(columns − 1). Once the margins are fixed, that many cells can vary freely and the rest follow. The formula is a count of genuine freedom, not an arbitrary rule.

Association, not causation

A significant chi-square establishes that the variables are associated. Whether one causes the other depends on the study design, and an observational two-way table cannot settle it.

Step 2: Try It Yourself

Tap and try it out.

Two groups compared on one variable. Convert to proportions before judging whether they differ.
Group 1 yes30
Group 1 no20
Group 2 yes20
Group 2 no30

Step 3: Watch an Example

One step at a time.

Watch Kofi Compute an Expected Count

A cell sits in a row totalling 50 and a column totalling 60, with a grand total of 200.

  1. Step 1

    The expected count multiplies the row total by the column total.

Step 4: Your Turn

Practice makes it stick.

The Expected Count

Problem 1 of 2

Row total 50, column total 60, grand total 200. What is the expected count?

The Degrees of Freedom

Problem 2 of 2

A 3 by 4 table. What are the degrees of freedom?

Tables and Tests

1 of 8

A 2 by 2 table. Degrees of freedom?

2 of 8

A 4 by 5 table. Degrees of freedom?

3 of 8

Row total 40, column total 50, grand total 200. Expected count?

4 of 8

One sample classified by two variables. Which test? 1 independence, 2 homogeneity.

5 of 8

Several separate samples compared on one variable. Which test? 1 or 2?

6 of 8

Does the arithmetic differ between the two tests? 1 yes, 0 no.

7 of 8

Sort each study by which chi-square test it needs.

Tap something to move it.

  • Empty
  • Empty

8 of 8

A 3 by 3 table. Degrees of freedom?

Step 5: Quick Check

Show what you know.

Question 1 of 2

A 2 by 5 table. What are the degrees of freedom?

Question 2 of 2

What distinguishes independence from homogeneity?

What You Learned

  • Expected counts are row total times column total over grand total.
  • Degrees of freedom are (rows − 1)(columns − 1).
  • Independence uses one sample; homogeneity compares several.