Tests for Homogeneity (College Board AP® Statistics): Revision Note
Test for homogeneity
What is a test for homogeneity?
A chi-square 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, , is that the distribution of the variable is the same for all the populations
e.g. : 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, , is that the distribution of the variable is not the same for all the populations
e.g. : 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
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
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, , with the critical value from the chi-square table
If , reject the null hypothesis
If , 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 test
This is often called a 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 ().
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 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
, 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
, 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!
Was this revision note helpful?
Build on this topic