Math
Test for independence.
Definition
A chi-square test for independence determines whether two categorical variables are associated or independent within a single population. It uses observed and expected frequencies in a two-way table to assess whether knowing one variable helps predict the other.
How it works · 5 phases
Step by step.
- State H₀: the two variables are independent (no association).
- Organize data into a two-way table of observed counts.
- Calculate expected counts: (row total × column total) / grand total.
- Compute χ² = Σ (observed − expected)² / expected.
- Determine the p-value using df = (r − 1)(c − 1) and draw a conclusion.
Examples
Real-world.
- 1 Testing whether gender and preferred study method are independent among college students
- 2 Determining if there is an association between exercise frequency and sleep quality
- 3 Checking whether phone brand preference is independent of age group
Key Fact
χ² = Σ (O − E)² / E; H₀ states the two variables are independent