Achievable logoAchievable logo
AP Statistics
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. One variable data
2. Two variable data
3. Data collection
4. Probability and random variables
5. Sampling distributions
6. Categorical data
7. Quantitative data
8. Chi-square
8.1 Goodness of fit test
8.2 Independence test
8.3 Homogeneity test
9. Linear regression
Wrapping up
Achievable logoAchievable logo
8.3 Homogeneity test
Achievable AP Statistics
8. Chi-square
Our AP Statistics course is currently in development and is a work-in-progress.

Homogeneity test

5 min read
Font
Discuss
Share
Feedback

Chi-Square Test for Homogeneity

The chi-square test for homogeneity is used to determine whether two or more populations have the same distribution of a single categorical variable. Unlike the test of independence (which uses one sample classified by two variables), the test for homogeneity uses separate samples from different populations and compares them on the same categorical variable.

Definitions

Chi-Square Test for Homogeneity: A statistical test used to compare the distribution of a categorical variable across two or more populations or groups using separate random samples from each.

Expected Frequency: The count we would expect in each cell if the null hypothesis (that all populations have the same distribution) were true. Calculated as:

Expected=grand total(row total)(column total)​

Degrees of Freedom: For a chi-square test for homogeneity, df=(r−1)(c−1), where r is the number of rows and c is the number of columns.

When to Use It

Use a chi-square test for homogeneity when:

  • You have separate random samples from two or more populations (or treatment groups).
  • You want to compare the distribution of a single categorical variable across those groups.

Hypotheses for a Chi-Square Test for Homogeneity

H0​: The distribution of the categorical variable is the same across all populations.

Ha​: The distribution of the categorical variable is not the same across all populations (at least one population differs).

Conditions for Inference

  1. Random: The data come from separate random samples from each population (or from a randomized experiment).
  2. 10% (if sampling without replacement): Each sample size is less than 10% of its respective population.
  3. Large Counts: All expected counts are at least 5.

Practice problem

A manufacturing company wants to determine whether its safety training program produces the same proficiency rates across four departments. The company takes independent random samples from each department and records whether each worker is proficient or not proficient on the post-training assessment.

Department Sampled Proficient Not Proficient
Welding 90 68 22
Assembly 110 75 35
Shipping 80 50 30
Quality Control 100 85 15

Test, at the α=0.05 level, whether the distribution of proficiency is the same across all four departments.

Part a. State the hypotheses.

(spoiler)

H0​: The distribution of proficiency (proficient vs. not proficient) is the same across all four departments.

Ha​: The distribution of proficiency is not the same across all four departments.

Part b. Organize the observed data into a two-way table.

Welding Assembly Shipping Quality Control Total
Proficient 68 75 50 85 278
Not Proficient 22 35 30 15 102
Total 90 110 80 100 380

Part c. Check the conditions for inference.

Random: The problem states the company took independent random samples from each department. ✓

10%: Each sample is reasonably less than 10% of the workers in its department (assuming each department has at least 10 times the sample size). ✓

Large Counts: Compute expected counts using Expected=380(row total)(column total)​.

Expected (Proficient, Welding) ​=380(278)(90)​≈65.84​

Expected (Proficient, Assembly) ​=380(278)(110)​≈80.47​

Expected (Proficient, Shipping) ​=380(278)(80)​≈58.53​

Expected (Proficient, Quality Control) ​=380(278)(100)​≈73.16​

Expected (Not Proficient, Welding) ​=380(102)(90)​≈24.16​

Expected (Not Proficient, Assembly) ​=380(102)(110)​≈29.53​

Expected (Not Proficient, Shipping) ​=380(102)(80)​≈21.47​

Expected (Not Proficient, Quality Control) ​=380(102)(100)​≈26.84​

(spoiler)

All expected counts are at least 5 (smallest is ≈21.47), so the Large Counts condition is met. All three conditions are satisfied — we can proceed with the chi-square test for homogeneity.

Part d. Find the chi-square test statistic and p-value.

Using the TI-84:

  1. Enter the observed counts into Matrix [A] (2 rows × 4 columns).
  2. Press STAT → TESTS → χ²-Test.
  3. Set Observed: [A], Expected: [B] (the calculator will fill [B] automatically).
  4. Highlight Calculate and press ENTER.

The degrees of freedom: df=(2−1)(4−1)=3.

(spoiler)

χ2≈14.99

p-value≈0.0018

df=3

Part e. Interpret the results in context.

Compare the p-value to α=0.05.

(spoiler)

Since p-value≈0.0018<0.05, we reject H0​.

We have convincing evidence that the distribution of proficiency is not the same across all four departments. In other words, at least one department has a different proficiency rate after the safety training program.

Chi-square test for homogeneity

  • Tests if a categorical variable’s distribution is the same across multiple populations/groups
  • Used with two or more groups and one categorical variable
  • Answers: Are category proportions the same in every group?

Conditions for use

  • Independent random samples from each group
  • Sample size less than 10% of each population
  • All expected counts at least 5
    • Expected count formula: Expected=Grand Total(Row Total)×(Column Total)​

Hypotheses

  • Null hypothesis (H0​): Distribution is the same across all populations
  • Alternative hypothesis (Ha​): Distributions are not the same across all populations

Test procedure

  • Organize observed data in a two-way table (categories × groups)
  • Calculate expected counts for each cell
  • Compute test statistic: χ2=∑Expected(Observed−Expected)2​
  • Find p-value using χ2 distribution with appropriate degrees of freedom

Decision rules

  • If p<α or χcalculated2​>χcritical2​: Reject H0​ (evidence distributions differ)
  • If p>α or χcalculated2​≤χcritical2​: Fail to reject H0​ (no evidence of difference)

Interpreting results

  • Large χ2 (small p-value): Observed counts differ from expected, evidence against homogeneity
  • Small χ2 (large p-value): Observed counts close to expected, little evidence against homogeneity

Sign up for free to take 8 quiz questions on this topic

Previous
Next  | 9.1 Slope and sampling distribution
All rights reserved ©2016 - 2026 Achievable, Inc.

Homogeneity test

Chi-Square Test for Homogeneity

The chi-square test for homogeneity is used to determine whether two or more populations have the same distribution of a single categorical variable. Unlike the test of independence (which uses one sample classified by two variables), the test for homogeneity uses separate samples from different populations and compares them on the same categorical variable.

Definitions

Chi-Square Test for Homogeneity: A statistical test used to compare the distribution of a categorical variable across two or more populations or groups using separate random samples from each.

Expected Frequency: The count we would expect in each cell if the null hypothesis (that all populations have the same distribution) were true. Calculated as:

Expected=grand total(row total)(column total)​

Degrees of Freedom: For a chi-square test for homogeneity, df=(r−1)(c−1), where r is the number of rows and c is the number of columns.

When to Use It

Use a chi-square test for homogeneity when:

  • You have separate random samples from two or more populations (or treatment groups).
  • You want to compare the distribution of a single categorical variable across those groups.

Hypotheses for a Chi-Square Test for Homogeneity

H0​: The distribution of the categorical variable is the same across all populations.

Ha​: The distribution of the categorical variable is not the same across all populations (at least one population differs).

Conditions for Inference

  1. Random: The data come from separate random samples from each population (or from a randomized experiment).
  2. 10% (if sampling without replacement): Each sample size is less than 10% of its respective population.
  3. Large Counts: All expected counts are at least 5.

Practice problem

A manufacturing company wants to determine whether its safety training program produces the same proficiency rates across four departments. The company takes independent random samples from each department and records whether each worker is proficient or not proficient on the post-training assessment.

Department Sampled Proficient Not Proficient
Welding 90 68 22
Assembly 110 75 35
Shipping 80 50 30
Quality Control 100 85 15

Test, at the α=0.05 level, whether the distribution of proficiency is the same across all four departments.

Part a. State the hypotheses.

(spoiler)

H0​: The distribution of proficiency (proficient vs. not proficient) is the same across all four departments.

Ha​: The distribution of proficiency is not the same across all four departments.

Part b. Organize the observed data into a two-way table.

Welding Assembly Shipping Quality Control Total
Proficient 68 75 50 85 278
Not Proficient 22 35 30 15 102
Total 90 110 80 100 380

Part c. Check the conditions for inference.

Random: The problem states the company took independent random samples from each department. ✓

10%: Each sample is reasonably less than 10% of the workers in its department (assuming each department has at least 10 times the sample size). ✓

Large Counts: Compute expected counts using Expected=380(row total)(column total)​.

Expected (Proficient, Welding) ​=380(278)(90)​≈65.84​

Expected (Proficient, Assembly) ​=380(278)(110)​≈80.47​

Expected (Proficient, Shipping) ​=380(278)(80)​≈58.53​

Expected (Proficient, Quality Control) ​=380(278)(100)​≈73.16​

Expected (Not Proficient, Welding) ​=380(102)(90)​≈24.16​

Expected (Not Proficient, Assembly) ​=380(102)(110)​≈29.53​

Expected (Not Proficient, Shipping) ​=380(102)(80)​≈21.47​

Expected (Not Proficient, Quality Control) ​=380(102)(100)​≈26.84​

(spoiler)

All expected counts are at least 5 (smallest is ≈21.47), so the Large Counts condition is met. All three conditions are satisfied — we can proceed with the chi-square test for homogeneity.

Part d. Find the chi-square test statistic and p-value.

Using the TI-84:

  1. Enter the observed counts into Matrix [A] (2 rows × 4 columns).
  2. Press {`STAT`} → {`TESTS`} → {`χ²-Test`}.
  3. Set Observed: [A], Expected: [B] (the calculator will fill [B] automatically).
  4. Highlight {`Calculate`} and press {`ENTER`}.

The degrees of freedom: df=(2−1)(4−1)=3.

(spoiler)

χ2≈14.99

p-value≈0.0018

df=3

Part e. Interpret the results in context.

Compare the p-value to α=0.05.

(spoiler)

Since p-value≈0.0018<0.05, we reject H0​.

We have convincing evidence that the distribution of proficiency is not the same across all four departments. In other words, at least one department has a different proficiency rate after the safety training program.

Key points

Chi-square test for homogeneity

  • Tests if a categorical variable’s distribution is the same across multiple populations/groups
  • Used with two or more groups and one categorical variable
  • Answers: Are category proportions the same in every group?

Conditions for use

  • Independent random samples from each group
  • Sample size less than 10% of each population
  • All expected counts at least 5
    • Expected count formula: Expected=Grand Total(Row Total)×(Column Total)​

Hypotheses

  • Null hypothesis (H0​): Distribution is the same across all populations
  • Alternative hypothesis (Ha​): Distributions are not the same across all populations

Test procedure

  • Organize observed data in a two-way table (categories × groups)
  • Calculate expected counts for each cell
  • Compute test statistic: χ2=∑Expected(Observed−Expected)2​
  • Find p-value using χ2 distribution with appropriate degrees of freedom

Decision rules

  • If p<α or χcalculated2​>χcritical2​: Reject H0​ (evidence distributions differ)
  • If p>α or χcalculated2​≤χcritical2​: Fail to reject H0​ (no evidence of difference)

Interpreting results

  • Large χ2 (small p-value): Observed counts differ from expected, evidence against homogeneity
  • Small χ2 (large p-value): Observed counts close to expected, little evidence against homogeneity

More from Chi-square

  • Goodness of fit test
  • Independence test