Tests from Two-Way Tables
Another form of data that we can use χ² tests for involves data from a two-way table (like the one pictured below).

When performing a χ² test from a two-way table, there are two different tests we may have to perform, and choosing which one can be tricky.
Test for Homogeneity
A chi-squared test for homogeneity is used to compare the distribution of a categorical variable between two or more independent groups or populations. It tests the null hypothesis that the proportions of the categories are the same in all the groups. In other words, we'll use the chi-squared test for homogeneity when we're comparing two different populations to see if they have different amounts for a given categorical variable.
Test for Independence
A chi-squared test for independence is used to examine the relationship between two categorical variables in a single population. It tests the null hypothesis that the two variables are independent, meaning that the presence or absence of one variable does not affect the probability of the other variable. In other words, we'll use this test when we're comparing within one population to see if two categorical variables are associated.
Expected Counts
Regardless of which test we are doing, we will be comparing two multi-row/column matrices rather than just two rows or columns. This means we have to calculate the expected counts matrix based on our observed counts table. This will be done by doing the following for each cell:

Where n = table total.
Example
In the first cell of the two-way table above on SUV and sports car ownership in regard to male or female, we would take the total male (60) and the total SUV (156), multiply those to get 9360. Then we would divide that total by our table total (240) and get 39. We would complete this process for all cells to create our expected count table.
Our final expected counts answer would be:

Applications
In the next sections, we will talk about setting up the two types of χ² tests regarding a two-way table and how we will use these observed and expected counts to determine if we have an association or homogeneity between our two variables/populations. Stay tuned 'til then!
Question for Chapter Notes: Expected Counts in Two Way Tables
Try yourself:
What does a chi-squared test for homogeneity compare?Explanation
The chi-squared test for homogeneity is used to compare the distribution of a categorical variable between two or more independent groups.Here’s a simple breakdown:
- It checks if proportions are the same across groups.
- It's used for comparing multiple populations.
- Focuses on categorical data.
Report a problem
Key Terms to Review
- Chi-Squared Test for Homogeneity: A statistical method used to determine if two or more populations have the same distribution for a categorical variable.
- Chi-Squared Test for Independence: A statistical method used to determine whether there is a significant association between two categorical variables.
- Expected Counts: The predicted frequencies of occurrences in a contingency table under the assumption of independence or homogeneity.
- Proportions: Represent a part of a whole, typically expressed as a fraction or percentage, crucial for comparing different groups.
- Test for Independence: A method used to determine whether there is a significant association between two categorical variables.
- χ² tests: Statistical methods used to determine whether there is a significant association between categorical variables.