Chi-Square Test of Homogeneity – Learn It 3

  • Complete a chi-square test of homogeneity

Expected Counts

We can calculate the expected count of any cell in a frequency table by calculating:

[latex]\frac{\text{row total}\times \text{column total}}{\text{total}}[/latex]

As with the goodness of fit test, we need to find the expected count for each group. In this case, our null hypothesis is that the distribution of proportions of outcomes for each year is the same. We estimate those proportions by looking at the overall proportions for each outcome among all three years.

Overall

  Adopted Returned to Owner Transferred Euthanized Total
Total 1,629 981 199 264 3,073

With adoptions, there were [latex]1,629[/latex] dogs adopted in total out of the total [latex]3,073[/latex] dogs for all three years we’re considering. So, the estimated adoption proportion for all three years is:

[latex]\dfrac{1,629}{3,073}=0.53010088 \approx 53.0\%[/latex]

If the distributions are the same, or homogeneous (i.e., if the null hypothesis is true), we would expect each year to have about [latex]53.0\%[/latex] of its dogs be adopted. The year 2022, for example, would have an expected count of adoptions that is about [latex]53.0\%[/latex] of the total [latex]837[/latex] dogs that left the shelter in 2022.

In this case, we will use more decimal places in our calculation to avoid rounding errors:

[latex]0.53010088*837=443.7[/latex]

Note that since the expected counts are theoretical values, they do not need to be whole numbers.

Notice that once we had the expected adoption counts for 2022 and 2023, we could have just subtracted those from the total number of adoptions in order to find the expected count for 2024. (Try this out to check your answer!) The same goes for each column: once we have two of the expected counts, we can find the third by subtracting. Similarly, in each row, once we have three of the expected counts, we can find the fourth by subtracting. This gives us [latex]2*3=6[/latex] degrees of freedom for our chi-square test of homogeneity. (In other words, once we have filled in six cells in the table of expected counts, we can fill in the others by subtracting.)

degree of freedom ([latex]df[/latex])

In general, if the two-way table for a homogeneity test has [latex]C[/latex] columns and [latex]R[/latex] rows, then there are [latex](R-1)(C-1)[/latex] degrees of freedom.

Notice that in our example, there are three rows (representing years) and four columns (representing outcomes), which gives [latex](3-1)(4-1)=2*3=6[/latex] degrees of freedom, as we saw previously.