Source: Tables created by Katherine Williams
This tutorial talks about the chi-square test for homogeneity. So with the chi-square test for homogeneity our null hypothesis is that there's no difference in the categorical variable across several populations or treatments. So the key here is that it's across several populations. It's not inside one of them, it's across many of them. And then the alternative hypothesis is going to be that there is a difference in the categorical variable across several populations.
When you're doing it, again, there are several conditions that you need to check. These are the same as the other chi-square tests, but it's good to review. First, your data needs to come from a random sample. Secondly, all the expected counts need to be at least five. And additionally, the individual observations need to be independent. So if those conditions are not met, then the conclusions that you draw from your chi-square test might not necessarily be correct.
So here's an example. We've setup our null hypothesis. And in this case, there are many null hypotheses. Our first one is that the proportion of basketball players in 9th grade is equal to the proportion of basketball players in 12th grade. The second one is that the proportion of soccer players in 9th grade equals the proportion of soccer players in 12th grade. And that the proportion of people who play some other sport in 9th grade is the same as the proportion of people who play some other sport in the 12th grade.
So we need to set up a null hypothesis for each category that we're comparing. So we're going across several populations. So the populations we're looking at are the freshmen and the seniors, and we're evaluating the categories for each one. And then the alternative hypothesis are for each of those, that they are not equal.
So now when we compute our chi-squared statistic, we get 19.91. And then when we want to determine whether or not that's a large number or a small number, we use our chi-square distribution table. And I know that has a P-value of 0.00005. Now, that is a very small number. No matter what significance level we had set, whether we had set a 5% or a 1%, we would have determined that we can reject the null hypothesis for this test.
This has been your tutorial on the chi-square test for homogeneity.