What Is a Chi-Square Test?

Definition

The chi-square test is a statistical test used to determine whether there is a significant association between two categorical variables. It compares the frequencies you actually observe in your data to the frequencies you would expect if there were no relationship.

How It Works

You organize your data into a table of observed counts, calculate expected counts (what you would see if the variables were unrelated), and measure how far the observed values deviate from the expected ones.

Example

A school surveys 200 students about their preferred subject and gender.

If subject preference were independent of gender, you would expect roughly equal proportions. The chi-square test calculates whether the actual pattern differs enough from this expectation.

Result: chi-square = 8.4, p-value = 0.015. Since p < 0.05, there is a statistically significant association between gender and subject preference in this sample.

Why It Matters

The chi-square test is one of the most commonly used tests for categorical data. Market researchers use it to check if product preferences differ by demographic group. Medical researchers use it to test whether a treatment outcome is associated with patient characteristics.

Unlike tests that work with numerical data (like the t-test), the chi-square test works with counts and categories. This makes it essential when your data involves groups, labels, or yes/no outcomes rather than continuous measurements.

Key Takeaway

Use the chi-square test when you need to check if two categorical variables are related. It is the go-to test for count data organized in tables.

← Back to Glossary