Wiki Page, Math 13 - Perez Sandbox : Module 27 - Wrap Up "Chi-Square Test for Independence"

Wiki Page
2026-01-17T21:15:48-08:00

Let's Summarize the Chi-square Test of Independence

In the test of independence, we consider one population and two categorical variables.

The null hypothesis says the two variables are independent (or not associated). The alternative hypothesis says the two variables are dependent (or associated).

To test our hypotheses, we select a single random sample and gather data for two different categorical variables.

Example: Do men and women differ in their perception of their weight? Select a random sample of adults. Ask them two questions: (1) Are you male or female? (2) Do you feel that you are overweight, underweight, or about right in weight?

The Chi-Square Test Statistic and Distribution

For all chi-square tests, the chi-square test statistic is the same. It measures how far the observed data are from the null hypothesis by comparing observed counts and expected counts. Expected counts are the counts we expect to see if the null hypothesis is true.

A chi-square model is a good fit for the distribution of the chi-square test statistic only if the following conditions are met:

The sample is randomly selected.

All expected counts are 5 or greater.

If these conditions are met, we use the chi-square distribution to find the P-value. We use the same logic that we have used in all hypothesis tests to draw a conclusion based on the P-value. If the P-value is at least as small as the significance level, we reject the null hypothesis and accept the alternative hypothesis. The P-value is the likelihood that results from random samples have a value equal to or greater than that calculated from the data if the null hypothesis is true.