Tests for Homogeneity (College Board AP® Statistics): Study Guide

Naomi C

Written by: Naomi C

Reviewed by: Dan Finlay

Updated on

Test for homogeneity

What is a test for homogeneity?

  • A chi-square (χ2) test for homogeneity is used to determine whether the distribution of a single categorical variable is the same across two or more populations or treatment groups

  • For example, you may have collected data on the preferred sport of random samples of students from three different schools

    • A test for homogeneity could show whether the distribution of preferred sports is the same at all three schools

  • The test compares the observed counts with the expected counts you would get if the distribution of the variable were the same for all the populations

    • See the Chi-Square Distribution note for how to calculate expected counts, the chi-square test statistic and the degrees of freedom

  • The observed counts are shown in a two-way table (as they are for a test for independence)

    • However, one of the variables in the table identifies the separate populations (or groups), rather than being a variable measured on each individual

  • E.g. a two-way table for the preferred sport of random samples of students from 3 different schools is shown below

    • A test for homogeneity asks whether the proportions of students who prefer each sport are the same at all three schools

Preferred sport

Soccer

Basketball

Swimming

Total

School

School 1

37

78

25

140

School 2

25

36

19

80

School 3

48

106

26

180

Total

110

220

70

400

Examiner Tips and Tricks

The chi-square test for independence and the chi-square test for homogeneity are calculated in the same way, so they are often confused. The difference is in how the data are collected and what the hypotheses say.

A test for independence uses one sample from a single population and asks whether two variables are associated. A test for homogeneity uses separate samples from different populations (or groups from an experiment) and asks whether the distribution of one variable is the same across them.

What are the null and alternative hypotheses for a homogeneity test?

  • The null hypothesis, H0, is that the distribution of the variable is the same for all the populations

    • e.g. H0 : The distribution of preferred sport is the same for students at Schools 1, 2 and 3

      • It is assumed to be correct, unless there is convincing evidence against it

  • The alternative hypothesis, Ha, is that the distribution of the variable is not the same for all the populations

    • e.g. Ha : The distribution of preferred sport is not the same for students at Schools 1, 2 and 3

What are the conditions for a homogeneity test?

  • When performing a chi-square test for homogeneity, check that

    • the data come from independent random samples from each population

      • or from random assignment of treatments in an experiment

    • if sampling without replacement, each sample size is less than or equal to 10% of its population size

      • This is not needed when treatments are randomly assigned in an experiment

    • all expected counts are greater than 5

      • This is sometimes called the large counts condition

How do I find the expected counts, test statistic and degrees of freedom?

  • These are found in the same way as for any chi-square test (see the Chi-Square Distribution note)

  • E.g. for the table above, the expected count for students at School 2 who prefer soccer is 80×110400=22

  • The table below shows all the expected counts for the example above

Preferred sport

Soccer

Basketball

Swimming

Total

School

School 1

38.5

77

24.5

140

School 2

22

44

14

80

School 3

49.5

99

31.5

180

Total

110

220

70

400

  • All the expected counts are greater than 5, so the large counts condition is met

  • The table has 3 rows and 3 columns, so the degrees of freedom are df=(3−1)(3−1)=4

How do I conclude a hypothesis test?

  • Conclusions to a hypothesis test need to show two things:

    • a decision about the null hypothesis

    • an interpretation of this decision in the context of the question

  • To make the decision, compare the p-value with the significance level, α

    • If p-value ≤α, reject the null hypothesis

      • There is convincing statistical evidence that the distribution of the variable is not the same for all the populations

    • If p-value >α, fail to reject the null hypothesis

      • There is not convincing statistical evidence that the distribution of the variable is different for the populations

  • Alternatively, compare the test statistic, χ2, with the critical value from the chi-square table

    • If χ2≥critical value, reject the null hypothesis

    • If χ2<critical value, fail to reject the null hypothesis

  • Failing to reject the null hypothesis does not show that the distributions are the same

    • It only means there is not convincing evidence that they are different

How can I perform a homogeneity test on the calculator?

  • To complete a test for homogeneity on your calculator:

    • Enter the observed counts into a matrix

    • Perform a χ2 test

      • This is often called a χ2 two-way test on a calculator

    • The calculator gives the test statistic, the p-value and the degrees of freedom

  • Compare the p-value with the significance level, α

Examiner Tips and Tricks

Even if you perform the test on your calculator, show your work. Depending on the question, you may need to show how the chi-square test statistic is calculated in full, or just how an expected count and the degrees of freedom are found.

Be careful with the inequalities: you reject the null hypothesis when the p-value is small (p-value ≤α), but when the test statistic is large (χ2≥critical value).

Worked Example

A political analyst wants to determine if voting preferences for three political parties (Party S, Party M and Party E) are the same across three different cities (City X, City Y and City Z) in a country. The analyst conducts a survey, randomly sampling 300 voters from each city. The results are shown in the table below.

Party S

Party M

Party E

Total

City X

122

97

81

300

City Y

91

109

100

300

City Z

137

84

79

300

Total

350

290

260

900

A chi-square test is conducted at the 10% significance level. All conditions for inference are met. The test statistic is χ2=15.769 and the p-value is 0.003.

What is the most appropriate conclusion to draw from this test?

(A) There is convincing statistical evidence that the distribution of party preference is the same for all three cities.

(B) There is not convincing statistical evidence that the distribution of party preference differs between the three cities.

(C) There is convincing statistical evidence that the city a voter lives in causes them to prefer a particular party.

(D) There is convincing statistical evidence that the distribution of party preference is not the same for all three cities.

Answer:

This is a test for homogeneity, so the null hypothesis is that the distribution of party preference is the same in each city

0.003≤0.1, so the p-value is less than the significance level

Or, alternatively, use the critical value for 4 degrees of freedom at the 10% significance level

df=(3−1)(3−1)=4

15.769≥7.78, so the test statistic is greater than the critical value

Therefore reject the null hypothesis: there is convincing statistical evidence that the distribution of party preference is not the same in all three cities

Consider option (A)

A hypothesis test can never give convincing evidence that the null hypothesis is true, so option A is incorrect

Consider option (B)

This is the conclusion you would give if you failed to reject the null hypothesis, but the p-value is less than the significance level, so option B is incorrect

Consider option (C)

The data come from an observational study, not an experiment, so a cause-and-effect conclusion cannot be made, so option C is incorrect

Consider option (D)

This is the correct conclusion when the null hypothesis is rejected, so option D is correct

The correct answer is D

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Naomi C

Author: Naomi C

Expertise: Maths Content Creator

Naomi graduated from Durham University in 2007 with a Masters degree in Civil Engineering. She has taught Mathematics in the UK, Malaysia and Switzerland covering GCSE, IGCSE, A-Level and IB. She particularly enjoys applying Mathematics to real life and endeavours to bring creativity to the content she creates.

Dan Finlay

Reviewer: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.