Chi Squared Test
Chi Squared Test
Used to test if your results fit the pattern you expected. Check if any differences seen between the predicted results and the actual results are due to chance (so dont matter) or show a significant difference.
4 5 6 7 8 9 10
E
(O-E) (O-E)2 ((O-E)2 /E) ((O-E)2 /E) 2 =
10
0 0 0 0 + 0.8 + 1.6 = 2.4
20
-4 16 0.8
10
4 16 1.6
= 2.4 2 df
= 2.4 2 df
Fits Pattern
Doesnt Fit
H0: The observed frequencies are homogeneous and any departure is due to sampling error or scatter. H1: The observed frequencies depart from those expected of a homogeneous distribution by an amount that cannot be accounted for by sampling error. If H0 is true we would expect to find the 75 pupae evenly distributed between the four species. 75/43 = 18.75
Dixella larvae are found in ponds. A scientist wanted to know if the four species were distributed evenly. As it is impossible to distinguish between species in the larval stage there would be no observer bias. The pupae were collected and when the adult midges emerged they were tallied. D. amphibia 10 18.75 D. attica 9 18.75 32 18.75
D. autumnalis O E
1. Work out the value for 2 2. Use the 2 table to work out the probability. 3. What does this mean in terms of H0 and H1? 4. Are the species distributed homogenously? How do you know?
D. aestivalis
24 18.75
2 =
degrees of freedom
Answers
D. autumnalis D. aestivalis O E (O-E) (O-E)2 ((O-E)2 /E) 2 = 24 18.75 5.25 27.5625 1.47 32 18.75 13.25 175.5625 9.36 D. amphibia 10 18.75 -8.75 76.5625 4.08 D. attica 9 18.75 -9.75 95.0625 5.07
Scenario 1
2. Exceeds the critical values for P =0.05 and P=0.01 SO in less than 1 in 100 samples we would see a difference due to chance. There is a statistically highly significant departure from homogeneity between the categories 2 = 19.98, P < 0.01. 3. Reject H0 in favour of H1 4. So they are NOT distributed homogenously Significantly more D. aestivalis and D. attica is in the minority
D. Freedom 1 A biologist prepares a computer program to produce integers between 0 and 9 to use for random sampling. After a few trials the biologist suspects the program is biased. Are they right? 2 3 4 5 6
5. Write a null hypothesis and an alternative hypothesis for this situation 6. Work out the 2 value. 7. Is the programme biased? How do you know? 8. What does this mean in terms of your null hypothesis.
P= 0.05 3.84 5.99 7.81 9.49 11.07 12.59 14.07 15.51 16.92 18.31
7 8 9 10 3 6 10 4 14 10 5 8 10 6 11 10 7 11 10 8 12 10 9 11 10
0 O E (O-E) (O-E)2
((O-E)2 /E)
((O-E)2 /E)
1 7 10
2 10 10
10 10
9. Use the table to indicate if the H0 would be accepted or rejected in each case.
2
15.51 7.25 12.31
n
8 4 10 2
df
Accept H0?
2 =
[Degrees of freedom=
4.67
Scenario 2 Answers
0 O E (O-E) (O-E)2
((O-E)2 /E)
((O-E)2 /E)
1 7 10 -3 9 0.9
2 10 10 0 0 0
3 6 10 -4 16 1.6 5.2
4 14 10 4 16 1.6
5 8 10 -2 4 0.4
6 11 10 1 1 0.1
7 11 10 1 1 0.1
8 12 10 2 4 0.4
9 11 10 1 1 0.1
10 10 0 0 0
0 + 0.9 + 0 + 1.6 + 1.6 + 0.4 + 0.1 + 0.1 + 0.4 + 0.1 = 5.2 [Degrees of freedom = 9]
2 =
Scenario 2 Answers
P is more than 0.05 so it is not biased errors seen are due to chance. There is no significant difference so accept the null hypothesis. Null hypothesis is assuming the data fits Smaller figure accept H0
2
15.51 7.25 12.31 4.67
n
8 4 10 2
df
7 3 9 1
Accept H0?
N Y Y N