The chi-square (χ2) distribution is often used in hypothesis testing to determine whether the deviation between observed and expected values is due to chance or may be statistically significant. The χ2 statistic is calculated using the equation
χ2 = Σ((O-E)2/E)
where O represents an observed value and E represents an expected value for an observation category. The summation sign Σ indicates that the quotient (O-E)2/E is calculated for each category and summed over all the categories.
The p value is the probability that the difference between two sets of values is due to chance. The χ2 value and the following table are used to determine the range in which the p value falls. In most scientific disciplines, a p value of 0.05 is chosen as the threshold for statistical significance. The degrees of freedom (df) is generally the number of categories compared minus one.
Critical values of the χ2 distribution