This banner appears on articles that are weak and whose contents should be approached with academic caution.

A chi-square test is any statistical hypothesis test in which the test statistic has a chi-square distribution if the null hypothesis is true. These include:

The most common form of the test statistic is: where the word "expected" often does not denote an expected value, but an observable estimate of an expected value. However, likelihood ratio tests do not have this form.

The chi-square test is a statistical tool to separate real effects from random variation. It can be used on data that is:

1. randomly drawn from the population
2. reported in raw counts of frequency (not percentages or rates)
3. measured variables must be independent
4. values on independent and dependent variables must be mutually exclusive
5. observed frequencies cannot be too small

The chi-square test determines the probability of obtaining the observed results by chance, under a specific hypothesis. It tests independence as well as goodness of fit for a set of data.

p value (e.g., p = 0.05). It is an indication of the likelihood of obtaining a result (0.05 = 5%). As such, it is relatively uninformative. A more helpful accompanying statistic is phi (or Cramer's phi, or Cramer's V). Phi is a measure of association that reports a value for the correlation between the two dichotomous variables compared in a chi-square test (2 × 2). This value gives you an indication of the extent of the relationship between the two variables. Cramer's phi can be used for even larger comparisons. It is a more meaningful measure of the practical significance of the chi-square test and is reported as the effect size.

## Chi-square test for contingency table

A chi-square test may be applied on a contingency table for testing a null hypothesis of independence of rows and columns.

## Example

A fair coin is one where heads and tails are equally likely to turn up after it is flipped. You are given a coin and asked to test if it is fair. After 100 trials, heads turn up 53 times and tails result 47 times. Here is a Chi-square analysis, where the null hypothesis is that the coin is fair:

 Heads Tails Total Observed 53 47 100 Expected 50 50 100 (O − E)2 9 9 χ2 0.360 0.360

Since there is one(1) degree of freedom, p = 0.5485. There is thus a 54.85% chance of seeing this data if the coin is fair, which is not considered statistically significant evidence that the coin is NOT fair.