Statistical Formula for the Chi-Square Test

The following table shows the notation used in this topic.

NotationDescription
Observed frequency in row i, column j. This value is weighted in a weighted table, unweighted in an unweighted table.
Number of rows contributing to the test.
Number of columns contributing to the test.
The total in row i:
The total in column j:
The total in the table or section of the table being tested:
The expected value in the table or section of the table being tested:

where, for Pearson's formula:

and for the Yates' correction:

The degrees of freedom are:

For details of Fisher's exact test, see Appendix 5, p562-564, SPSS 7.5 Statistical Algorithms (1997), Chicago, IL: SPSS Inc. ISBN 1-56827-185-9.