Fiveable

📊Honors Statistics Unit 11 Review

QR code for Honors Statistics practice questions

11.5 Comparison of the Chi-Square Tests

11.5 Comparison of the Chi-Square Tests

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
📊Honors Statistics
Unit & Topic Study Guides
Pep mascot

Chi-Square Tests

Chi-square tests let you analyze categorical data by comparing what you actually observe to what you'd expect under some assumption. All three types use the same core formula, but they answer fundamentally different questions. Knowing which test to use, and why, is the main challenge here.

Each test calculates a chi-square statistic from observed and expected frequencies, then uses degrees of freedom to find a p-value. The decision framework is the same across all three; what changes is the setup: how many populations, how many variables, and what the null hypothesis claims.

Pep mascot
more resources to help you study

Goodness-of-Fit vs. Independence vs. Homogeneity

These three tests look similar in mechanics but differ in structure and purpose.

Goodness-of-fit tests whether a single categorical variable's distribution matches a specific claimed distribution. You have one population and one variable. You're comparing observed frequencies against expected frequencies derived from the hypothesized proportions.

Example: A candy company claims their bags are 20% red, 30% blue, and 50% green. You count the colors in a sample bag and test whether the observed counts match those claimed proportions.

Independence tests whether two categorical variables are related within a single population. You have one population but two variables, and you're asking: does knowing one variable tell you anything about the other?

Example: You survey one group of consumers and record both gender and product preference. The question is whether product preference differs by gender, or whether the two variables are independent.

Data for independence tests gets organized into a contingency table (rows for one variable, columns for the other).

Homogeneity tests whether the distribution of a single categorical variable is the same across two or more populations. You have multiple populations but one variable.

Example: You survey voters in three different age groups and ask which candidate they support. The question is whether the distribution of candidate support is consistent across age groups.

A common point of confusion: independence and homogeneity tests both use contingency tables and the same formula for expected counts. The difference is in the study design. Independence starts with one sample and measures two variables on each subject. Homogeneity starts with separate samples from distinct populations and measures one variable.

Goodness-of-fit vs independence tests, Chi-square Goodness of Fit test

Null and Alternative Hypotheses

Each test has its own hypothesis structure:

  • Goodness-of-fit
    • H0H_0: The data follows the hypothesized distribution (observed proportions match expected proportions)
    • HaH_a: The data does not follow the hypothesized distribution
  • Independence
    • H0H_0: The two categorical variables are independent
    • HaH_a: The two categorical variables are not independent (they are associated)
  • Homogeneity
    • H0H_0: The distribution of the categorical variable is the same across all populations
    • HaH_a: The distribution differs for at least one population

Notice that all three alternative hypotheses are non-directional. Chi-square tests only detect that something deviates from the null; they don't tell you how it deviates. If you reject H0H_0, you'll need to look at individual cell contributions to understand where the differences are.

Goodness-of-fit vs independence tests, PSPP for Beginners

Populations and Variables at a Glance

Test# of Populations# of VariablesWhat You're Comparing
Goodness-of-fit11Observed vs. hypothesized distribution
Independence12Whether two variables are related
Homogeneity2+1Whether distributions match across groups

Chi-Square Test Statistic and Interpretation

All three tests use the same test statistic formula:

χ2=(OE)2E\chi^2 = \sum \frac{(O - E)^2}{E}

where OO is each observed frequency and EE is the corresponding expected frequency. Each cell contributes one term to the sum, and larger differences between observed and expected values push χ2\chi^2 higher.

Degrees of freedom differ by test type:

  • Goodness-of-fit: df=k1df = k - 1, where kk is the number of categories
  • Independence and homogeneity: df=(r1)(c1)df = (r - 1)(c - 1), where rr is the number of rows and cc is the number of columns in the contingency table

The p-value comes from the right tail of the chi-square distribution. A larger χ2\chi^2 means a smaller p-value, which means stronger evidence against H0H_0. You can also compare χ2\chi^2 to a critical value from a chi-square table at your chosen significance level. If χ2\chi^2 exceeds the critical value, you reject H0H_0.

One thing to watch: the chi-square approximation works well only when expected frequencies are large enough. The standard rule is that every expected cell count should be at least 5. If some cells fall below that threshold, you may need to combine categories or use a different method.