Tests of Independence for Frequency Data

Two-way tables (contingency tables) evaluate whether one property (e.g. eye color) occurs independently of another (e.g. sex). For this analysis, represent the categories (i.e. red eyes, white eyes, green eyes) of one variable with columns, categories of the second variable (i.e. male, female) in rows, and enter the observed frequencies for each cell. Expected frequencies are calculated for each cell under the null scenario. For example, if 20 out of 200 animals exhibit blue eyes and 100 of these 200 animals are male, then you would expect that 10 males would have blue eyes if you assume that eye color and sex are controlled independently of each other. If you find a large excess of male individuals with blue eyes then you may have evidence that eye color and sex are not independent characteristics.

If the difference between observed and expected frequencies is large then we have reason to suspect a link (i.e. lack of independence) between the two properties. Chi-square ("Chi2") or G-tests ("G-Val") determine whether these differences are large enough to warrant dropping the null hypothesis. Calculate the following sample statistic for your data:

X2 = S[(Observed-Expected)2 / Expected] =

and compare to the critical value from a Chi-square distribution.

William's correction is performed and all statistics must be compared to a Chi-square distribution with appropriate degrees of freedom. Freeman-Tukey deviates ("Cells") permit a cell-wise examination of the table to identify which cell values are particularly "large" or "small" compared to the null hypothesis.


General two-way table

using Applet "FreqMatrixApplet" Version 1.3.5 (updated on 3.5.98)
Columns:           
Rows: