Statistics

Chi-squared Test

Compare observed frequencies with expected frequencies in categorical data.

Purpose

A chi-squared test is used with categorical data. In IB Mathematics, common forms are goodness of fit and test for independence.

\[ \chi^2=\sum\frac{(O-E)^2}{E} \]

Here \(O\) means observed frequency and \(E\) means expected frequency.

Goodness of fit example

A fair die is rolled 60 times. Expected frequency for each face is 10. Suppose observed frequencies are \(8,12,9,11,10,10\).

  1. Use \(E=10\) for each face.
  2. \[\chi^2=\frac{(8-10)^2}{10}+\frac{(12-10)^2}{10}+\frac{(9-10)^2}{10}+\frac{(11-10)^2}{10}=1.0.\]
  3. Compare this value with a critical value or use technology to find the p-value.

Degrees of freedom

For goodness of fit with \(k\) categories, degrees of freedom are usually \(k-1\). For a two-way table:

\[ (\text{rows}-1)(\text{columns}-1) \]