Suppose a contingency table has r rows and c columns. The entry, n_{ij}, in row i and column j of the contingency table is the frequency for that cell. The total in row i, n_{i.}, is the sum of the frequencies in row i. The total in column j, n_{.j}, is the sum of the frequencies in column j. The total for the table, n_{..} or just n, is the sum of all the frequencies in the table.

Profiles are proportions that are calculated from the counts, n_{ij}, in the original contingency table. Specifically, the profile for row i is (n_{i1} / n_{i.}, ..., n_{ic} / n_{i.}); the profile for column j is (n_{1j} / n_{.j}, ..., n_{rj} / n_{.j}).

The average row profile is calculated from the column totals. Specifically, the average row profile is (n._{1} / n, ..., n_{.c} / n). Similarly, the average column profile is calculated from the row totals. Specifically, the average column profile is (n_{1.} / n,..., n_{r.} / n).

Expected cell frequencies are calculated under the hypothesis that the row profiles, or equivalently the column profiles, are homogeneous. The expected frequency for the cell in row i and column j is calculated as follows:

The χ^{2} value in the cell in row i and column j is calculated as follows:

If the observed and expected cell frequencies differ greatly, the χ^{2} value for the cell is large.

The χ^{2} statistic is the sum of the χ^{2} values in all the cells of the table. This statistic measures the discrepancy from homogeneity of the row profiles, or equivalently the column profiles. If the row (column) profiles are very different from each other, the χ^{2} statistic is large. The χ^{2} statistic can also be viewed as a measure of how far the row profiles (or equivalently the column profiles) are from the average row (column) profile.

Term | Description |
---|---|

n_{ij} | observed frequency in the cell |

e_{ij} | expected frequency in the cell |