The chi-square statistic measures the difference between actual and expected counts in a statistical experiment. These experiments can vary from two way tables to multinomial experiments. The actual counts are from observations, the expected counts are typically determined from probabilistic or other mathematical models.
In the above formula we are looking at n pairs of expected and observed counts. The symbol ek denotes the expected counts, and fk denotes the observed counts. To calculate the statistic, we do the following steps:
- Calculate the difference between corresponding actual and expected counts.
- Square the differences from the previous step, similar to the formula for standard deviation.
- Divide every one of the squared difference by the corresponding expected value.
- Add all of these numbers together to give us our chi-square statistic.
The result is a nonnegative number that tells us how much different the actual and expected counts are. If we compute that χ2 = 0, then this indicates that there are no differences between any of our observed and expected counts.
An alternate form of the equation for the chi-square statistic uses summation notation in order to write the equation more compactly. This is seen in the second line of the above equation.