The Chi-Squared Test

Sometimes it is possible to make a quantitative prediction about the outcome of an experiment. A good example of this is a genetic cross, where Mendel's laws can be used to predict numbers of different phenotypes. You would never expect your actual results to be identical to the prediction, but you would expect them to be close. How close? The chi-squared (c2) test looks at the difference between the predicted results and the observed results and tells you the probability (P) that this difference is due to random chance alone.

Again P varies from 0 (not likely) to 1 (certain). The higher the probability, the more likely it is that any differences from the theory are just due to random chance and that your results support your prediction. The lower the probability, the less likely it is that the differences from the theory are due to random chance, so the differences are significant and your results do not support your prediction. Again the critical probability is usually taken as 0.05 (or 5%). So if p > 0.05 then the results agree with the prediction, and if p < 0.05 then the results do not agree with the prediction.

In Excel the c2 test is performed using the formula: =CHITEST (observed range, expected range) .

For example in one of Mendel's experiments, 705 plants had red flowers and 224 had white flowers. Do the results support the 3:1 ratio of Mendel's law? The spreadsheet on the right shows how this can be tested using the c2 test. Cells B2-B3 contain the observed results and B4 calculates their sum. The expected results (in column C) are calculated from this: 3/4 should be red (C2) and 1/4 white (C3). The sum in C4 should then be the same as the sum B4. Cell B5 contains the c2 probability of 0.5319. This probability is much greater than the critical value of 0.05, so any diferences are just due to chance, and the results do indeed support Mendel's law.

Incidentally a very high P (>0.9) is suspicious, as it means that the results are just too good to be true! This suggests that there is some bias in the experiment, whether deliberate or accidental.

The null hypothesis. Sometimes you cannot make a quantitative prediction, but there is trick you can do instead. Make a hypothesis (called the null hypothesis) that all the results should all be the same. This may not be a sensible hypothesis, but it is quantitative. For example the sex of children born in certain hospital over a period was: 242 boys, 203 girls. There seem to be more boys than girls, but is the difference significant? Using the null hypothesis that there should be equal numbers of each sex we can do the c2 test shown on the left. The probability is just > 0.05, so there is no significant difference in the numbers of boys and girls.

 

The Equations

 

Chi-Squared Test

where O is the observed result

and E is the expected result

The probability is then found from a table of c2 values.