my notes to do a chi squared test

advertisement
STATISTICS FOR FREQUENCY DATA



Sometimes the data from an experiment are not measurements but counts (or frequencies) of
things, such as counts of different phenotypes in a genetics cross, or counts of species in
different habitats or even numbers of organisms turning left or right at a junction. With
frequency data you can use a chi-squared (2) test.
A 2 test compares the observed results with some theoretical expected results The test is
designed to convert the differences (or deviations) between the two into the probability of their
occurring by chance, taking into account both the size of the sample and the number of variables
(degrees of freedom).
In Excel the 2 test is performed using the formula: =CHITEST (observed range, expected
range) . Excel automatically works out the 2 value for the data and the degrees of freedom
involved, the result than is actually displayed is the decimal probability that the results arose by
chance
Sometimes the expected data are calculated by assuming that the counts in all the categories should
be the same, in which case you are testing whether there is a difference between the counts. If the
chi squared test returns a P <0.05 then the counts are significantly different from each other, and if
P >0.05 then there is no significant difference between the counts.
In the example below the sex of children born in a hospital over a period of time is compared. The
expected values are calculated by assuming there should be equal numbers of boys and girls, and the
2 P of 0.16 is greater than greater than 0.05 so the odserved results are not significantly different
from the expected results.
HERE’S HOW YOU USE EXCEL TO CALCULATE A 2
1. select the cell you want the answer in
2. select insert, function
3. Select statistical, and CHITEST – then OK
4. Drag you cell references – or type them into the boxes that appear (note you can use the red hide
show boxes if you want)
5. Press OK
You now have the decimal probability that the results arose by chance.
Download