AP Statistics · Unit 3 · Topic 3.14

Setting Up a Chi-Square Test Study Lab

A chi-square test works on a two-way table of counts. The sampling design tells you whether it is a test for homogeneity or for independence. Pick the test, edit the observed counts, and watch the expected counts and conditions update.

1. Set up a chi-square test

Chi-square tests compare observed counts in a two-way table with the counts we would expect if H₀ were true. First decide which test the study design calls for, then compute the expected counts and check the conditions.

Expected = (row total × column total) ÷ table total df = (rows − 1)(columns − 1)
Preset studies

The study

Which test fits the design?

State: hypotheses

Observed counts edit any cell

Expected counts if H₀ is true

Each cell shows its calculation. Red cells have an expected count below 5.

Plan: conditions

Observed vs. expected distributions

Rows × columns
Degrees of freedom
Smallest expected count
Test

2. Key ideas

Homogeneity

Several groups, one variable

Use a test for homogeneity when you have separate random samples (or treatment groups) and compare the distribution of one categorical variable across them.

Independence

One group, two variables

Use a test for independence when you have a single random sample and record two categorical variables for each individual, asking whether they are associated.

Hypotheses

Written in words

Homogeneity: H₀ says the distributions are the same in every population. Independence: H₀ says there is no association between the two variables.

Expected counts

What H₀ predicts

Expected count = (row total)(column total) ÷ table total. These are the counts you would expect if the rows all had the same distribution.

Conditions

Random, 10%, expected ≥ 5

Data from random samples or random assignment; each sample at most 10% of its population; and every expected count at least 5.

Degrees of freedom

(r − 1)(c − 1)

df depends only on the size of the table. A 3 × 4 table has (3 − 1)(4 − 1) = 6 degrees of freedom.

3. Quick reference

Choosing and setting up a chi-square test for a two-way table.

Test for homogeneityTest for independence
DesignTwo or more independent samples or treatment groupsOne sample
VariablesOne categorical variable per groupTwo categorical variables per individual
H₀The distribution of the variable is the same for all populationsThere is no association between the two variables
HₐThe distributions are not all the sameThere is an association
Expected count(row total)(column total) ÷ grand totalSame
df(rows − 1)(columns − 1)Same
ConditionsRandom, 10%, all expected ≥ 5Same

4. On the FRQ

How to earn the points

  • Name the test exactly: "chi-square test for homogeneity" or "chi-square test for independence." The design decides which.
  • Write hypotheses in context with words, naming the populations or variables.
  • Show at least one expected count calculation: (80)(72) ÷ 240 = 24.
  • State that all expected counts are at least 5, and give the smallest one.
  • Give df = (r − 1)(c − 1) with numbers.

Common mistakes

  • Choosing the test from the table's shape. Both tests use a two-way table; the sampling design decides.
  • Checking that observed counts are at least 5 instead of expected counts.
  • Rounding expected counts to whole numbers.
  • Writing hypotheses about a single proportion, like p₁ = p₂, when there are more than two categories.
  • Using df = n − 1 instead of (r − 1)(c − 1).

5. Practice questions

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

0 / 0 correct

6. Key terms

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