Chi-Square Test for Independence
- State hypotheses for a test of independence
- Compute the chi-square statistic and degrees of freedom for a two-way table
- Interpret the conclusion in context
One sample, two variables
A chi-square test for independence uses a single sample and asks whether two categorical variables measured on it are associated. H₀: the two variables are independent (no association) in the population; Hₐ: they are associated. Example: draw one random sample of students and record both their grade level and their preferred learning style, then test whether the two are related.
The statistic and degrees of freedom
Compute χ² = Σ (observed − expected)²/expected over all cells, with expected counts from the row×column/total formula. For a two-way table the degrees of freedom = (rows − 1)(columns − 1). A large χ² gives a small p-value and evidence of association. Conditions: Random sample, Large Counts (all expected ≥ 5), and 10% for independence of individuals.
A single random sample of adults is classified by exercise level (3 categories) and stress level (3 categories). The chi-square statistic is 18.2. Find the degrees of freedom and describe how to reach a conclusion at α = 0.05.
- 1.This is a test for independence (one sample, two variables). H₀: exercise and stress levels are independent; Hₐ: they are associated.
- 2.Degrees of freedom: df = (r − 1)(c − 1) = (3 − 1)(3 − 1) = 2 × 2 = 4.
- 3.Find the p-value as the area to the right of χ² = 18.2 under the chi-square distribution with df = 4 (p-value ≈ 0.001).
- 4.Since the p-value < 0.05, reject H₀.
A chi-square test is applied to a two-way table with 4 rows and 3 columns. How many degrees of freedom does it have?
A chi-square test can establish an association, but on its own it never establishes causation — the data come from an observational classification, not a randomized experiment. Conclude "there is evidence of an association," not "one variable causes the other."
A chi-square test for independence yields a very small p-value. What is the correct conclusion?
Answer the 2 checkpoints as you read.
Sign in to save your progress