x2 Test
The x2 test first requires that the data be arranged in a contingency table like the one below. The column may have as many columns and rows as necessary to accommodate all of the categories.
Treatment | Control | Total | |
Positive | a | b | r1 |
Negative | c | d | r2 |
Total | c1 | c2 | N |
Once the observed values are in the table, the expected values for each cell are calculated by taking the product of its row total and its column total then dividing by the grand total (N).
The hypotheses are
Ho: there is no association between the factors
HA: there is an association
and the x2 statistic is calculated by
where E is the expected value for a cell and O is its observed value.
The critical value can be found in the x2 table with (# of rows-1)(# of columns-1) degrees of freedom and the desired alpha value. If the x2 statistic is larger than the critical value, the null hypothesis that there is no association between the factors is rejected.