Chi-square tests: goodness of fit and independence

MathematicsNumbers & ArithmeticCommunity

Loading…

Use with my class ✨ Customize with AI Report a problem

Switch between a goodness-of-fit test and a test of independence. Edit observed counts for a die-style experiment or a contingency table and watch the expected counts, each (O−E)²/E contribution, the χ² statistic, the degrees of freedom and the p-value update live. The χ² distribution curve shows the critical value, the statistic and the shaded p-value area.

Lesson: In a goodness-of-fit test the expected count of each category is E = N ÷ k under the null hypothesis of equal proportions. Each category adds (O − E)²/E to χ², so categories far from their expected count contribute most. With df = k − 1, the p-value is the area under the χ² curve to the right of the statistic. If χ² is larger than the critical value (equivalently p < α) we reject H₀. More degrees of freedom move the curve to the right, and doubling all counts while keeping their proportions doubles χ². The test is only reliable when every expected count is at least 5. In a test of independence each cell's expected count is E = row total × column total ÷ N, so it depends only on the totals, and df = (r − 1)(c − 1).

Created by a teacher with Simulic AI and reviewed by the Simulic team.

How to use

Parameters you can change

  • Significance level α 0.01–0.1
  • Number of categories 2–6
  • Table rows 2–4
  • Table columns 2–4
  • Colour cells by contribution