Pearson's chi-squared test

Pearson's chi-squared test or Pearson's test is a statistical test applied to sets of categorical data to evaluate how likely it is that any observed difference between the sets arose by chance. It is the most widely used of many chi-squared tests (e.g., Yates, likelihood ratio, portmanteau test in time series, etc.) – statistical procedures whose results are evaluated by reference to the chi-squared distribution. Its properties were first investigated by Karl Pearson in 1900.[1] In contexts where it is important to improve a distinction between the test statistic and its distribution, names similar to Pearson χ-squared test or statistic are used.

It is a p-value test. The setup is as follows:[2][3]

  • Before the experiment, the experimenter fixes a certain number of samples to take.
  • The observed data is , the count number of samples from a finite set of given categories. They satisfy .
  • The null hypothesis is that the count numbers are sampled from a multinomial distribution . That is, the underlying data is sampled IID from a categorical distribution over the given categories.
  • The Pearson's chi-squared test statistic is defined as . The p-value of the test statistic is computed either numerically or by looking it up in a table.
  • If the p-value is small enough (usually p < 0.05 by convention), then the null hypothesis is rejected, and we conclude that the observed data does not follow the multinomial distribution.

A simple example is testing the hypothesis that an ordinary six-sided dice is "fair" (i. e., all six outcomes are equally likely to occur). In this case, the observed data is , the number of times that the dice has fallen on each number. The null hypothesis is , and . As detailed below, if , then the fairness of dice can be rejected at the level of .

  1. ^ Pearson, Karl (1900). "On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling". Philosophical Magazine. Series 5. 50 (302): 157–175. doi:10.1080/14786440009463897.
  2. ^ Loukas, Orestis; Chung, Ho Ryun (2022). "Entropy-based Characterization of Modeling Constraints". arXiv:2206.14105 [stat.ME].
  3. ^ Loukas, Orestis; Chung, Ho Ryun (2023). "Total Empiricism: Learning from Data". arXiv:2311.08315 [math.ST].