2. Chi-squared (χ2
) test
• This test compares measurements relating to
the frequency of individuals in defined
categories e.g. the numbers of white and
purple flowers in a population of pea plants.
• Chi-squared is used to test if the observed
frequency fits the frequency you expected or
predicted.
3. How do we calculate the expected
frequency?
• You might expect the observed frequency of
your data to match a specific ratio. e.g. a 3:1
ratio of phenotypes in a genetic cross.
• Or you may predict a homogenous distribution
of individuals in an environment. e.g. numbers
of daisies counted in quadrats on a field.
Note: In some cases you might expect the observed
frequencies to match the expected, in others you
might hope for a difference between them.
4. Example 1: GENETICS
Comparing the observed frequency of
different types of maize grains with the
expected ratio calculated using a
Punnett square.
5. The photo shows four different phenotypes for maize grain,
as follows:
Purple & Smooth (A), Purple & Shrunken (B), Yellow &
Smooth (C) and Yellow & Shrunken (D)
6. Gametes PS Ps pS ps
PS PPSS PPSs PpSS PpSs
Ps PPSs PPss PpSs Ppss
pS PpSS PpSs ppSS ppSs
ps PpSs Ppss ppSs ppss
The Punnett square below shows the
expected ratio of phenotypes from crosses of
four genotypes of maize.
A : B : C : D = 9 : 3 : 3 : 1
7. H0 = there is no statistically significant difference
between the observed frequency of maize grains
and the expected frequency (the 9:3:3:1 ratio)
HA = there is a significant difference between the
observed frequency of maize grains and the
expected frequency
If the value for χ2
exceeds the critical value (P =
0.05), then you can reject the null hypothesis.
What is the null hypothesis (H0)?
8. Calculating χ2
χ2
= (O – E)2
E
Σ
O = the observed results
E = the expected (or predicted) results
10. Compare your calculated value of χ2 with the critical value
in your stats table
Our value of χ2
= 7.91
Degrees of freedom = no. of categories - 1 = 3
D.F. Critical Value
(P = 0.05)
1 3.84
2 5.99
3 7.82
4 9.49
5 11.07
Our value for χ2
exceeds the
critical value, so we can reject
the null hypothesis.
There is a significant difference
between our expected and
observed ratios. i.e. they are a
poor fit.
11. Example 2: ECOLOGY
• One section of a river was trawled and four
species of fish counted and frequencies
recorded.
• The expected frequency is equal numbers of the
four fish species to be present in the sample.
12. H0 = there is no statistically significant difference
between the observed frequency of fish species and
the expected frequency.
HA = there is a significant difference between the
observed frequency of fish and the expected
frequency
If the value for χ2
exceeds the critical value (P =
0.05), then you can reject the null hypothesis.
What is the null hypothesis (H0)?
13. Calculating χ2
χ2
= (O – E)2
E
Σ
O = the observed results
E = the expected (or predicted) results
14. Species O E O-E (O-E)2
(O-E)2
E
Rudd 15 10 5 25 2.5
Roach 15 10 5 25 2.5
Dace 4 10 -6 36 3.6
Bream 6 10 -4 16 1.6
Σ 40 40 χ2
= 10.2
15. Compare your calculated value of χ2 with the critical value
in your table of critical values.
Our value of χ2
= 10.2
Degrees of freedom = no. of categories - 1 = 3
D.F. Critical Value
(P = 0.05)
1 3.84
2 5.99
3 7.82
4 9.49
5 11.07
Our value for χ2 exceeds the
critical value, so we can reject
the null hypothesis.
There is a significant difference
between our expected and
observed frequencies of fish
species.
16. Example 3: ECOLOGY
• Do 2 plant species A and B grow independently
of one another?
• Quadrats taken to see if each plant species is
present or absent
• The expected frequency is equal numbers of the
two species to be present in the sample.
20. • Null hypothesis:
• If the plants grow independently of each
other there should be no statistically
significant difference in the number of
species A seen when B is present as
when it is absent! And vice versa
21. Example 4: CONTINGENCY TABLES
You can use contingency tables to calculate
expected frequencies when the relationship
between two quantities is being investigated.
In this example we will look
at the incidence of colour
blindness in both males and
females.
22. H0 = there is no statistically significant difference
between the observed frequency of colour blindness
in males and females.
HA = there is a significant difference between the
between the observed frequency of colour blindness
in males and females
If the value for χ2
exceeds the critical value (P =
0.05), then you can reject the null hypothesis.
What is the null hypothesis (H0)?
23. Observed frequencies Males Females
Colour blind 56 14
Not colour blind 754 536
e.g.
The expected frequency
for colour blind males =
(56 + 14) x (56 + 754)
1360
= 42
Expected Cell Frequency = (Row Total x Column Total)
n
25. Compare your calculated value of χ2 with the critical value
in your table of critical values
Our value of χ2
= 12.33
Deg of Freedom = (2 rows - 1) x (2 cols – 1) = 1
D.F. Critical Value
(P = 0.05)
1 3.84
2 5.99
3 7.82
4 9.49
5 11.07
Our value for χ2 exceeds the
critical value, so we can reject
the null hypothesis.
There is a significant difference
between our expected and
observed frequencies.
The fraction of males with colour
blindness is greater than that in
females. The difference cannot
be attributed to chance alone.