| Study Guides
AP · Chi-Square Test for Homogeneity · 14 min read · Updated 2026-05-10

Chi-Square Test for Homogeneity — AP Statistics Study Guide

For: AP Statistics candidates sitting AP Statistics.

Covers: Hypothesis formulation, expected count calculation, chi-square test statistic computation, degrees of freedom calculation, inference conditions, p-value interpretation, and contextual conclusions for tests of distribution homogeneity across multiple populations.

You should already know: Basics of hypothesis testing for categorical data, how to read and interpret contingency tables, the core mechanics of the chi-square test for goodness of fit.

A note on the practice questions: All worked questions in the "Practice Questions" section below are original problems written by us in the AP Statistics style for educational use. They are not reproductions of past College Board / Cambridge / IB papers and may differ in wording, numerical values, or context. Use them to practise the technique; cross-check with official mark schemes for grading conventions.


1. What Is Chi-Square Test for Homogeneity?

The chi-square test for homogeneity is a hypothesis-based inference procedure used to test whether the distribution of a single categorical response variable is homogeneous (identical) across two or more independent populations or treatment groups.

A common source of confusion early on is distinguishing this test from the other two chi-square tests on the AP exam: unlike the chi-square test for goodness-of-fit (which compares one sample’s distribution to a single hypothesized distribution) and the chi-square test for independence (which tests for association between two categorical variables from a single population sample), the homogeneity test starts with separate, independent random samples from each population of interest.

This topic is part of Unit 8: Inference for Categorical Data: Chi-Square in the AP Statistics CED, which accounts for 10–15% of the total exam score. Chi-square test for homogeneity questions appear on both the multiple-choice (MCQ) and free-response (FRQ) sections of the exam; it regularly appears as a full 4-point FRQ or a 2–3 point subpart of a longer inference FRQ.

2. Hypotheses and Conditions for Inference

The first step in any chi-square test for homogeneity is correctly stating the null and alternative hypotheses, then verifying that all conditions for inference are met.

For hypotheses, the null hypothesis () always states that the distribution of the categorical variable is the same across all populations. The alternative hypothesis () states that at least one population has a different distribution of the categorical variable. In formal notation, for populations and categories of the response variable: Where is the proportion of population that falls into response category .

Three conditions must be satisfied for the test to be valid per the AP CED:

  1. Random: Data come from independent random samples from each population, or from groups in a randomized controlled experiment.
  2. Independence: Individual observations are independent within each sample. When sampling without replacement, the total sample size must be less than 10% of the total population size.
  3. Large Counts: The expected count for every cell in the contingency table is at least 5.

Worked Example

A high school counselor wants to test whether the distribution of post-graduation plans (4-year college, 2-year college, full-time work, gap year) is the same for seniors in the general education, honors, and IB programs at her school. She takes independent random samples of 80 general ed, 100 honors, and 60 IB seniors. The smallest expected count in her contingency table is 7.1. State the hypotheses and check conditions for inference.

  1. Define parameters: Let be the proportion of program that plans for outcome , where = 1 (4-year) to 4 (gap year), and = 1 (gen ed), 2 (honors), 3 (IB).
  2. State hypotheses: : The distribution of post-graduation plans is homogeneous across the three programs. : The distribution of post-graduation plans differs across at least one of the three programs.
  3. Check Random: Independent random samples were taken from each program, so this condition is satisfied.
  4. Check Independence: The total number of seniors sampled is 240, which is less than 10% of all seniors at any large public high school, so the 10% condition for independence is met.
  5. Check Large Counts: The smallest expected count is 7.1, which is greater than 5, so this condition is satisfied.

All conditions for inference are met.

Exam tip: Always state hypotheses in the context of the problem, not just generic symbols. AP exam readers require contextual hypotheses to award full credit for the inference step.

3. Test Statistic and Degrees of Freedom Calculation

Once you have confirmed hypotheses and conditions, the next step is to calculate the chi-square test statistic and degrees of freedom.

First, calculate the expected count for each cell in an contingency table, where is the number of rows (response categories) and is the number of columns (populations/groups). The formula for expected count for the cell in row , column is: Intuition: If the null hypothesis of homogeneity is true, the overall proportion of observations in each row should apply equally to all columns, so we multiply the column sample size by the overall row proportion to get the count we expect if is true.

Once all expected counts are calculated, the chi-square test statistic is: Where is the observed count for the cell and is the expected count. Larger values of indicate larger differences between observed and expected counts, so stronger evidence against .

Degrees of freedom (df) for the test are calculated as: This df is used to find the p-value from the right-skewed chi-square distribution.

Worked Example

A market researcher tests whether the distribution of snack preference (salty, sweet, savory, other) is homogeneous across three age groups: children, teens, adults. The observed contingency table is below:

Preference Children Teens Adults Row Total
Salty 25 20 15 60
Sweet 22 28 20 70
Savory 10 12 28 50
Other 3 5 7 15
Col Total 60 65 70 195

Calculate the chi-square test statistic and degrees of freedom for this test.

  1. Calculate expected counts for each cell: For example, Salty/Children: , Savory/Adults: .
  2. Calculate the term for each cell, then sum all terms: .
  3. Calculate df: (preference categories), (age groups), so .

The test statistic is with 6 degrees of freedom.

Exam tip: Always label the row and column totals correctly when plugging into the expected count formula. Mixing up row and column totals will give the wrong expected count and lose points on FRQ.

4. Drawing a Conclusion in Context

The final step of any hypothesis test is to compare the p-value to the pre-specified significance level (almost always on the AP exam, unless stated otherwise) and draw a conclusion that answers the original research question in context.

For chi-square tests, the p-value is the probability of observing a test statistic as large or larger than the one calculated, if the null hypothesis of homogeneity is true. Because larger values indicate more evidence against , all p-values correspond to the area to the right of the test statistic under the chi-square distribution with the appropriate degrees of freedom.

The decision rule is straightforward: if -value , reject . If -value , fail to reject . A critical rule to remember is that you never "accept" the null hypothesis; you only fail to reject it, because we cannot prove the distributions are identical, only that we do not have enough evidence to say they differ.

A template for full credit on AP exams is: "Since [p-value < α / p-value ≥ α], we [reject / fail to reject] . There [is / is not] sufficient evidence at the significance level to conclude that the distribution of [response variable] differs across at least one of the [populations/groups]."

Worked Example

Using the snack preference example from Section 3, we have with . The p-value for this test is between 0.01 and 0.02. Using , state an appropriate conclusion.

  1. Compare p-value to : The p-value is between 0.01 and 0.02, which is less than .
  2. Make the decision: We reject the null hypothesis of homogeneity.
  3. Conclusion in context: There is sufficient evidence at the 0.05 significance level to conclude that the distribution of snack preference differs across at least one of the three age groups (children, teens, adults).

If the p-value had been 0.08, the conclusion would be: "Since 0.08 > 0.05, we fail to reject . There is not sufficient evidence at the 0.05 significance level to conclude that the distribution of snack preference differs across the three age groups."

Exam tip: Never skip the context step in your conclusion. AP exam readers require a contextual conclusion to award the final point for the test, even if all calculations are correct.

5. Common Pitfalls (and how to avoid them)

  • Wrong move: Confusing the chi-square test for homogeneity with the chi-square test for independence, and describing hypotheses incorrectly for the study design. Why: Both tests use identical calculation methods for test statistic and df, so students often mix up the research question. Correct move: Always check the study design first: if you have independent samples from multiple populations and one response variable, it is homogeneity; if you have one sample and two categorical variables measured on each unit, it is independence.
  • Wrong move: Using the goodness-of-fit df formula instead of for a homogeneity test. Why: Students memorize goodness-of-fit first and confuse the two formulas. Correct move: For any chi-square test on a contingency table (homogeneity or independence), always use .
  • Wrong move: Claiming you "accept the null hypothesis" when the p-value is larger than . Why: Students get lazy with wording and forget that failing to reject is not the same as proving the null true. Correct move: Always use the phrasing "fail to reject the null hypothesis" when .
  • Wrong move: Checking the large counts condition against observed counts instead of expected counts. Why: Students see the "all counts ≥ 5" rule and check the given observed counts by default. Correct move: Always confirm all expected counts are ≥ 5 when checking the large counts condition.
  • Wrong move: Stating the alternative hypothesis as "all populations have different distributions" instead of "at least one population has a different distribution". Why: Students generalize incorrectly, assuming the alternative requires all groups to differ. Correct move: Always state the alternative as "at least one population has a different distribution of the response variable".
  • Wrong move: Calculating expected counts as , swapping the denominator. Why: Students rush when doing calculations and misremember the formula order. Correct move: Memorize "row times column over grand total" and write the formula down before plugging in numbers.

6. Practice Questions (AP Statistics Style)

Question 1 (Multiple Choice)

A political scientist tests whether the distribution of party affiliation (Democrat, Republican, Independent) is homogeneous across four regions of the US. He takes independent random samples of 100 registered voters from each region, and calculates a chi-square test statistic of 12.3. What is the range of the p-value for this test? A) B) C) D)

Worked Solution: First, calculate degrees of freedom: we have 3 party affiliation categories (rows, ) and 4 regions (columns, ), so . From the standard chi-square distribution table, for , corresponds to and corresponds to . Our test statistic 12.3 falls between these two values, so the p-value is between 0.05 and 0.10. The correct answer is C.


Question 2 (Free Response)

A university admissions office wants to test whether the distribution of admission decisions (accept, waitlist, reject) is homogeneous across in-state, out-of-state, and international applicant groups. Independent random samples of 200 applicants from each group gave the observed counts below:

Decision In-State Out-of-State International Row Total
Accept 72 54 41 167
Waitlist 30 33 32 95
Reject 98 113 127 338
Col Total 200 200 200 600

(a) State the appropriate null and alternative hypotheses for this test, and check all conditions for inference. The smallest expected count is 31.7. (b) Calculate the degrees of freedom for this test. (c) If the p-value for the test is 0.032, what conclusion do you draw at the significance level?

Worked Solution: (a) : The distribution of admission decisions is homogeneous across in-state, out-of-state, and international applicant groups. : The distribution of admission decisions differs across at least one applicant group. Conditions: Random independent samples are given, all observations are independent (total sample 600 < 10% of all applicants), and the smallest expected count is 31.7 ≥ 5. All conditions for inference are met. (b) (decision categories), (applicant groups), so . (c) Since -value = 0.032 < 0.05, we reject . There is sufficient evidence at the 0.05 significance level to conclude that the distribution of admission decisions differs across at least one of the three applicant groups.


Question 3 (Application / Real-World Style)

An ecologist studies whether the distribution of tree species (oak, maple, pine, birch) is homogeneous across three different soil types in a national forest. She takes independent random samples of 50 trees from each soil type, resulting in the table below:

Species Soil A Soil B Soil C Row Total
Oak 18 12 8 38
Maple 12 15 10 37
Pine 10 12 18 40
Birch 10 11 14 35
Col Total 50 50 50 150

Conduct a full chi-square test for homogeneity at the significance level and interpret your result in context.

Worked Solution:

  1. Hypotheses: : The distribution of tree species is homogeneous across the three soil types. : At least one soil type has a different distribution of tree species.
  2. Conditions: Independent random samples are given, all observations are independent, the smallest expected count is , so all conditions are met.
  3. Calculations: , .
  4. The p-value for with df=6 is between 0.20 and 0.25, which is greater than . We fail to reject .

Interpretation: There is not sufficient evidence at the 0.05 significance level to conclude that the distribution of tree species differs across the three soil types in the national forest.

7. Quick Reference Cheatsheet

Category Formula Notes
Null Hypothesis : Distribution of response is identical across all populations Use when you have independent samples from multiple groups
Alternative Hypothesis : At least one population has a different response distribution Never state "all distributions are different"
Expected Cell Count Applies to all contingency table chi-square tests
Chi-Square Test Statistic Larger values = stronger evidence against
Degrees of Freedom = number of response categories, = number of populations
Conditions for Inference Random, Independence, All AP CED requires all expected counts ≥ 5
Conclusion for Reject There is sufficient evidence that distributions differ
Conclusion for Fail to reject There is not sufficient evidence that distributions differ

8. What's Next

The chi-square test for homogeneity is the second of three core chi-square procedures in AP Statistics Unit 8, after goodness-of-fit and before the chi-square test for independence. Mastering the mechanics of contingency table calculations, hypothesis formulation, and condition checking for homogeneity is a critical prerequisite for the test of independence, which uses the same calculation framework but a different study design and research question. Without mastering this chapter, you will struggle to distinguish between the two contingency table chi-square tests, a common source of lost points on the AP exam. Beyond Unit 8, chi-square inference for categorical data is the foundation for more advanced procedures like logistic regression and categorical data analysis in post-AP statistics courses.

Chi-Square Test for Goodness of Fit Chi-Square Test for Independence Two-Sample Inference for Proportions

← Back to topic

Stuck on a specific question?
Snap a photo or paste your problem — Ollie (our AI tutor) walks through it step-by-step with diagrams.
Try Ollie free →