Vous êtes sur la page 1sur 12

2 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.

Where to draw the line?


R r
Sample size of 40 : Expected Results 10:20:10

R RR Rr You would expect a ratio of 1:2:1 r Rr rr


11:19:10 12:19:9 10:16:14

Do these fit the Tells us where to draw the line. pattern?

What to actually do...


Step 1: Work out the expected results (E) Step 2: Collect data from real situation (O) Step 3: Work out the difference (O-E) Step 4: Square these results, this gets rid of an negative values. (O-E)2 Degrees of P= 0.05 Step 5: Divide by the expected value ((O-E)2 /E) Freedom 2 Step 6: Add up all these values ((O-E) /E) 1 3.84 Step 7: Compare this result with the 2 table 2 5.99

7.81 9.49 11.07 12.59 14.07 15.51 16.92 18.31

Degrees of freedom = classes -1


Probability above 0.05 results ok
Probability below 0.05 significant differences

4 5 6 7 8 9 10

Taken 100 samples


RR O 10 Rr 16 rr 14

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 [degrees of freedom 3-1 = 2df ]

= 2.4 2 df

Reading the Table


Degrees of Freedom 1 2 3 4 Probability greater than 0.1 2.71 4.60 6.25 7.78 0.05 3.84 5.99 7.82 9.49 0.01 6.64 9.21 11.34 13.28 0.01 10.34 13.82 16.27 18.46

= 2.4 2 df

Fits Pattern

Doesnt Fit

Probability above 0.05 results ok Probability below 0.05 significant differences

Are the results basically the same?


High probability = youre results are fine Low probability = you messed up somewhere
Likely your expected values were incorrect Go back and rethink what you would expect to happen

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

(O-E) (O-E)2 ((O-E)2 /E)


((O-E)2 /E)

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

((O-E)2 /E) 1.47+9.36+4.08+5.07 = 19.98 19.98 [with 3 df]

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

Vous aimerez peut-être aussi